Skip to content

Commit

Permalink
Add soundmojis
Browse files Browse the repository at this point in the history
  • Loading branch information
sebm253 committed Jan 24, 2025
1 parent 69944d0 commit 3515858
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions discord/mentionable.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var (
MentionTypeEveryone = MentionType{regexp.MustCompile(`@everyone`)}
MentionTypeGuildNavigation = MentionType{regexp.MustCompile("<id:(browse|customize|guide|linked-roles)>")}
MentionTypeLinkedRole = MentionType{regexp.MustCompile(`<id:linked-roles:(\d+)>`)}
MentionTypeSoundmoji = MentionType{regexp.MustCompile(`<sound:(\d+):(\d+)>`)}
)

type Mentionable interface {
Expand Down Expand Up @@ -92,3 +93,7 @@ func NavigationLinkedRoles() string {
func NavigationLinkedRole(id snowflake.ID) string {
return fmt.Sprintf("<id:linked-roles:%d>", id)
}

func SoundmojiMention(guildID snowflake.ID, soundID snowflake.ID) string {
return fmt.Sprintf("<sound:%d:%d>", guildID, soundID)
}
1 change: 1 addition & 0 deletions discord/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ type Message struct {
Poll *Poll `json:"poll,omitempty"`
Call *MessageCall `json:"call,omitempty"`
Nonce Nonce `json:"nonce,omitempty"`
SoundboardSounds []SoundboardSound `json:"soundboard_sounds,omitempty"`
}

func (m *Message) UnmarshalJSON(data []byte) error {
Expand Down

0 comments on commit 3515858

Please sign in to comment.