这曾经用于每5分钟更改我的机器人的活动,但现在终端被垃圾邮件发送此速率限制警告:
WARNING discord.gateway WebSocket in shard ID None is ratelimited, waiting 0.00 seconds
个
它给出的数字有时也可能在57-59秒左右.我不认为5分钟的计时器太短而不能改变机器人的一些东西,我见过其他机器人每隔几分钟左右就会改变他们的个人资料图片,我想在服务器上这是非常苛刻的.有没有更好的方法来做这件事?代码如下.
actaray = ["PcktWtchr's Videos", "Cams", "and Listening Always", "or Listening or Both"]
# Start-up
@bot.event
async def on_ready():
print('Logged in as {0.user}'.format(bot))
while True:
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=random.choice(actaray)))
asyncio.sleep(300)
就像我说的,就我记忆所及,这招很管用.等待时间过go 是60秒,但因为它给了我速率限制,我将其增加到300秒,因为我认为它太快了.这个问题仍然存在.