【发布时间】:2017-10-25 22:33:15
【问题描述】:
我正在为我的不和谐机器人使用流氓异常包。
当用户通过命令调用机器人时,我希望机器人在执行命令之前删除他的消息。
所以在我的“MessageReceived”事件中,到目前为止我有这个代码:
private async Task MessageReceived(SocketMessage s)
{
var msg = s as SocketUserMessage; // the input
if (msg == null || !msg.Content.StartsWith("!") || msg.Author.IsBot) // return if null, msg is no command, msg is written by the bot
return;
if (msg.Channel is SocketGuildChannel guildChannel) // just delete the command if the msg is written in the guild channel, not a private message channel
await ??? // Delete the command
}
那么有人知道,那里写什么=?
【问题讨论】: