【发布时间】:2019-12-14 11:20:56
【问题描述】:
我正在使用重写制作一个不和谐的机器人,但是当我的命令运行时,它会发送两次消息 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())
【问题讨论】:
-
你有
on_message听众吗? -
提供更多代码
-
@PatrickHaugh 我没有或不需要,因为我正在使用 discord.ext.commands
-
@jerseyetr 我不想分享它,但我 100% 对函数的唯一引用是 @bot.command() 奇怪的是,只有第一条消息,(等等,我'正在收集数据)被发送两次。
标签: python-3.x discord discord.py