【发布时间】:2021-02-21 22:51:24
【问题描述】:
我正在制作自己的不和谐机器人。一旦用户发送-find,机器人就会发送一条消息我希望机器人等待用户回复它。机器人等待,但它无法识别消息。
@commands.command()
async def find(self, ctx):
members = [self.xxx, self.xxx, self.xxx]
member = random.choice(members)
image = member[0]
await ctx.send(f'{image}')
def check(m):
m.author == ctx.author and m.channel == ctx.channel
try:
await self.client.wait_for('message', timeout=8.0, check=check)
await ctx.send('yay!')
except:
await ctx.send('booo you suck')
try: @commands.command()
async def find(self, ctx):
members = [self.xxx, self.xxx, self.xxx]
member = random.choice(members)
image = member[0]
await ctx.send(f'{image}')
def check(m):
m.author == ctx.author and m.channel == ctx.channel
await self.client.wait_for('message', timeout=8.0, check=check)
await ctx.send('yay!')
except:
await ctx.send('booo you suck')
没有错误。我删除了尝试,除了查看是否有任何错误,但唯一显示的错误是超时。
【问题讨论】:
标签: discord discord.py