小编Air*_*hup的帖子

机器人两次执行相同的命令

我正在使用重写制作一个不和谐的机器人,但是当我的命令运行时,它会发送两次消息 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)

python-3.x discord discord.py

3
推荐指数
1
解决办法
4264
查看次数

标签 统计

discord ×1

discord.py ×1

python-3.x ×1