我的机器人中有一个命令,允许用户向我发送匿名消息。然而,当我测试命令时,我的机器人只向我发送消息的第一个字
@commands.command(name='msgetika', aliases=['msgmax'])
async def msgetika(self, ctx, message1=None):
'''Send an annonymous message to maxhatt3r'''
if message1 is None:
await ctx.send('Please specify a message')
maxid = await self.bot.fetch_user('584500826450427906')
await maxid.send('Anonymous message: ' + message1)
msg = await ctx.send('Sending message to max.')
await ctx.message.delete()
await asyncio.sleep(5)
await msg.delete()
如果要捕获整个短语,需要添加
*
View the docs here关于如何使用它,并查看代码下面的示例另外,除非您使用的是旧版本的discord.py,user ids are ^{}s
相关问题 更多 >
编程相关推荐