如何从生成器对象获取信息

时间:2019-01-05 17:53:52

标签: python bots discord

next()不起作用,因为它会引发此错误

Future exception was never retrieved
future: <Future finished exception=ServerDisconnectedError()>
aiohttp.errors.ServerDisconnectedError

我之前从未使用过生成器对象和异步对象,所以请原谅我完全无能

@client.event
async def on_message(message):
  if message.content.startswith('retrieve_'):
    await client.send_message(message.channel, next(client.get_message(message.channel,str(-2))))

0 个答案:

没有答案