public async ValueTask <CommandResult> HandleAsync(ICommandContext context) { var embed = new DiscordEmbedBuilder { Author = new DiscordEmbedBuilder.EmbedAuthor { Name = context.User.Username, IconUrl = context.User.AvatarUrl }, Description = Question, Color = context.Member.Color }; var builder = new DiscordFollowupMessageBuilder() .AddEmbed(embed); if (TargetRole is not null) { builder .WithContent(TargetRole.Mention) .AddMention(new RoleMention(TargetRole)); } var message = await context.RespondAsync(builder); var emoteYes = DiscordEmojiHelper.Parse(context.Client, UrfRidersEmotes.Checkmark); var emoteNo = DiscordEmojiHelper.Parse(context.Client, UrfRidersEmotes.Crossmark); _ = message.CreateReactionAsync(emoteYes); _ = message.CreateReactionAsync(emoteNo); // TODO: Show list of users that reacted in the message. return(CommandResult.NoAction); }
public async ValueTask <DiscordMessage> RespondAsync(string content) { var builder = new DiscordFollowupMessageBuilder() .WithContent(content); return(await RespondAsync(builder)); }
public async ValueTask <DiscordMessage> RespondAsync(DiscordEmbed embed) { if (IsEphemeral) { throw new InvalidOperationException("Embeds are not supported in ephemeral messages."); } var builder = new DiscordFollowupMessageBuilder() .AddEmbed(embed); return(await RespondAsync(builder)); }