【发布时间】:2020-10-27 14:51:23
【问题描述】:
每次我尝试使用commands.Bot(command_prefix=''),程序都会将其读取为错误。比如下面的代码,就出来了
忽略命令中的异常无:discord.ext.commands.errors.CommandNotFound:命令“-ping”不是 在命令无中发现忽略异常: discord.ext.commands.errors.CommandNotFound:命令“ping”不是 找到了
在我想让机器人说的内容(Pong!)之前重复几次,在服务器中发送 2 次或更多次...
\我认为它可能是循环的?我不确定,但我让它工作了一次,但是我等待的时间越长,每次使用它发送更多响应的命令? -我上次尝试时发送了 16 'Pong's...对此我有什么办法吗?\
我该如何解决这个问题?
from discord.ext import commands
client = commands.Bot(command_prefix='-')
@client.event
async def on_ready():
print("Bot is ready for use...")
@client.command()
async def ping(ctx):
await ctx.send('Pong')
client.run('TOKEN')
【问题讨论】:
标签: python command discord discord.py discord.py-rewrite