Skip to content

Commit 1328ec5

Browse files
committed
Add email and phone number mentions
discord/discord-api-docs#7657
1 parent 01bba29 commit 1328ec5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

discord/mentionable.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ var (
2222
MentionTypeEveryone = MentionType{regexp.MustCompile(`@everyone`)}
2323
MentionTypeGuildNavigation = MentionType{regexp.MustCompile("<id:(browse|customize|guide|linked-roles)>")}
2424
MentionTypeLinkedRole = MentionType{regexp.MustCompile(`<id:linked-roles:(\d+)>`)}
25+
MentionTypeEmail = MentionType{regexp.MustCompile(`<.+@.+>`)}
26+
MentionTypePhoneNumber = MentionType{regexp.MustCompile(`<\+.+>`)}
2527
)
2628

2729
type Mentionable interface {
@@ -92,3 +94,11 @@ func NavigationLinkedRoles() string {
9294
func NavigationLinkedRole(id snowflake.ID) string {
9395
return fmt.Sprintf("<id:linked-roles:%d>", id)
9496
}
97+
98+
func EmailMention(email string) string {
99+
return fmt.Sprintf("<%s>", email)
100+
}
101+
102+
func PhoneNumberMention(number string) string {
103+
return fmt.Sprintf("<%s>", number)
104+
}

0 commit comments

Comments
 (0)