有人知道如何在专用频道(DM)中使用bot.wait_for_message
吗?
答案 0 :(得分:0)
假设您只想接受来自特定用户的直接私人消息(而不是群组私人消息),则可以编写一张检查message.channel.type
def check(message):
return message.channel.type == discord.ChannelType.private
await bot.wait_for_message(timeout = 30, author = ctx.message.author, check=check, content="SSM")
如果您从私人频道收到命令,则可以正常等待该频道
await bot.wait_for_message(timeout = 30, author = ctx.message.author, channel=ctx.message.channel, content="SSM"