如何让机器人在 discord.net 中对自己的消息做出反应?
How to make a bot react to its own message in discord.net?
机器人发送一条消息 "Do u like or dislike smth" 并作出反应:拇指向上:和:拇指向下:,然后计算有多少人为每个选项投票。我该怎么做?
这是我现在的代码:
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:)。
我自己找到了答案,有我的代码:
[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);
}
机器人发送一条消息 "Do u like or dislike smth" 并作出反应:拇指向上:和:拇指向下:,然后计算有多少人为每个选项投票。我该怎么做? 这是我现在的代码:
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:)。
我自己找到了答案,有我的代码:
[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);
}