Bot在DM中针对特定消息Discord.net的重放

时间:2019-05-13 09:42:53

标签: vb.net discord.net

我试图使机器人发送私人消息并专注于特定单词。

例如,我输入:send_me_dm

在bot向我发送了dm消息后,如果我发送该dm“ hiiii”,则该机器人将通过“ hi”在dm中重播

我的代码:

If message.Content.Contains("send_me_dm") Then
    Dim user = TryCast(message.Author, SocketGuildUser)
    Await user.SendMessageAsync("you can talk with me") 'now it send as dm
End If

Dim channell As SocketTextChannel = discord.GetChannel(message.Channel.Id)

If message.Channel.Id.Equals(channell) Then
    If message.Content.Contains("hiiii") Then      
        Await channell.SendMessageAsync("hi")   
    End If
End If

0 个答案:

没有答案