我正在使用重写制作一个不和谐的机器人,但是当我的命令运行时,它会发送两次消息 100% 没有其他调用来发送该消息,而且它只是第一条消息(等等,我正在收集数据),即发送两次。这是命令的代码:
@bot.command()
async def testcmd(ctx):
print("called")
msgtemp = await ctx.message.channel.send("Hold on, I'm gathering the data")
print("sent")
time.sleep(3)
await msgtemp.delete()
with open("fileofthings.txt") as fl:
await ctx.send(fl.read())
Run Code Online (Sandbox Code Playgroud) 当我在 Spyder (Mac OS Big Sur) 中输入时,我遇到了一些明显的延迟。
我看到堆栈溢出帖子表明这个问题在最新版本的 Spyder 中已得到解决。然而,当我将 Spyder 更新到 4.2.3 时,我的滞后问题仍然存在。
所有输入都需要 1-3 秒来注册并显示在控制台和我正在编写的任何脚本中。我多次尝试重启,spyder也自行关闭。我确信这有某种关系。
我也尝试按照此链接中的步骤操作,但它们不起作用:https ://docs.spyder-ide.org/current/faq.html#troubleshooting-macos-bigsur