机器人会发送一条消息“您喜欢还是不喜欢水上运动”,并做出:thumb-up:和:thumb-down:的反应,然后计算有多少人为每个选项投票。我该怎么做? 这是我现在的代码:
public Task Respects(SocketGuildUser user)
{
var emoji = new Emoji("");
Context.Channel.SendMessageAsync($"What do u think about {user.Mention}'s message?");
return Context.Message.AddReactionAsync(emoji);
}
我不完全了解如何通过文本指示符(:thumb_up :)添加表情符号反应。
答案 0 :(得分:1)
我自己找到了答案,有我的代码:
[Command("respects"), Alias("F")]
[RequireBotPermission(GuildPermission.AddReactions)]
public async Task Respects(SocketGuildUser user)
{
var emoji = new Emoji("\uD83C\uDDEB");
string message = $"Press F to pay respects to {user.Mention}:";
var sent = await Context.Channel.SendMessageAsync(message);
await sent.AddReactionAsync(emoji);
}