有这样的代码:
client = discord.Client(intents=(discord.Intents.all()))
async def getMessages():
channel = client.get_channel(channel_id)
messages = await channel.history()
client.run(**TOKEN**)
但是,当启动并调用此函数时,机器人会冻结。我怎样才能解决这个问题?
有这样的代码:
client = discord.Client(intents=(discord.Intents.all()))
async def getMessages():
channel = client.get_channel(channel_id)
messages = await channel.history()
client.run(**TOKEN**)
但是,当启动并调用此函数时,机器人会冻结。我怎样才能解决这个问题?
阅读文档,一切都写在那里。