diff --git a/bot/extras/arguments/mention.go b/bot/extras/arguments/mention.go index cf54131..93b7527 100644 --- a/bot/extras/arguments/mention.go +++ b/bot/extras/arguments/mention.go @@ -13,6 +13,8 @@ var ( RoleRegex = regexp.MustCompile(`<@&(\d+)>`) ) +// + type ChannelMention discord.Snowflake func (m *ChannelMention) Parse(arg string) error { @@ -28,6 +30,12 @@ func (m *ChannelMention) ID() discord.Snowflake { return discord.Snowflake(*m) } +func (m *ChannelMention) Mention() string { + return "<#" + m.ID().String() + ">" +} + +// + type UserMention discord.Snowflake func (m *UserMention) Parse(arg string) error { @@ -43,6 +51,12 @@ func (m *UserMention) ID() discord.Snowflake { return discord.Snowflake(*m) } +func (m *UserMention) Mention() string { + return "<@" + m.ID().String() + ">" +} + +// + type RoleMention discord.Snowflake func (m *RoleMention) Parse(arg string) error { @@ -58,6 +72,12 @@ func (m *RoleMention) ID() discord.Snowflake { return discord.Snowflake(*m) } +func (m *RoleMention) Mention() string { + return "<&" + m.ID().String() + ">" +} + +// + func grabFirst(reg *regexp.Regexp, item, input string, output *discord.Snowflake) error {