Skip to content

Commit

Permalink
Merge pull request #29 from KennySchl/master
Browse files Browse the repository at this point in the history
feat: add support to resolve channel, message, and attachment
  • Loading branch information
amatsagu authored Jul 9, 2024
2 parents 9dc707c + ee96cb2 commit 9ff6fe9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions interaction-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ func (itx CommandInteraction) ResolveRole(id Snowflake) *Role {
return itx.Data.Resolved.Roles[id]
}

// Returns pointer to partial channel if present in interaction.data.resolved. It'll return <nil> if there's no resolved partial channel.
func (itx CommandInteraction) ResolveChannel(id Snowflake) *PartialChannel {
return itx.Data.Resolved.Channels[id]
}

// Returns pointer to message if present in interaction.data.resolved. It'll return <nil> if there's no resolved message.
func (itx CommandInteraction) ResolveMessage(id Snowflake) *Message {
return itx.Data.Resolved.Messages[id]
}

// Returns pointer to attachment if present in interaction.data.resolved. It'll return <nil> if there's no resolved attachment.
func (itx CommandInteraction) ResolveAttachment(id Snowflake) *Attachment {
return itx.Data.Resolved.Attachments[id]
}

// Use to let user/member know that bot is processing command.
// Make ephemeral = true to make notification visible only to target.
func (itx CommandInteraction) Defer(ephemeral bool) error {
Expand Down

0 comments on commit 9ff6fe9

Please sign in to comment.