#User Mentions Example

1 messages · Page 1 of 1 (latest)

elder crescent
#

Hi, does anyone have examples of mentioning channels/users/roles using code and how it looks in Discord if you add content?

glass meteor
elder crescent
# glass meteor it looks like this: <@260383142903414785>
    public static async Task OnDiscordServerJoin(DiscordClient sender, GuildCreateEventArgs args)
    {
        var msg = new DiscordMessageBuilder();
        var owner = args.Guild.Owner;
        var guildId = args.Guild.Id;
        var defaultChannel = args.Guild.GetDefaultChannel();
        msg.AddMention(new UserMention(owner));
        msg.WithContent("Hello, choose a channel please);

        await sender.SendMessageAsync(defaultChannel, msg);
    }
``` what would such code look like?
#

Will the mention be at the beginning or end of the text?

glass meteor
#

this doesn't mention anyone

#

it simply allows a ping to the person to go through

#

the mention still has to be placed in content

elder crescent
#

like

<@userUd>
``` ?
glass meteor
#

yes