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))))