【发布时间】:2022-01-15 14:24:18
【问题描述】:
所以我正在制作一个包含多个命令的不和谐机器人,但似乎只有最上面的一个可以工作。
import discord
import os
import time
import discord.ext
from discord.utils import get
from discord.ext import commands, tasks
from discord.ext.commands import has_permissions, CheckFailure, check
client = discord.Client()
client = commands.Bot(command_prefix = '$')
count = 0
@client.event
async def on_ready():
print("Ready")
@client.command()
async def clear(ctx, amount=100):
await ctx.channel.purge(limit=amount)
return
async def hello(ctx):
await ctx.send("Hi")
async def help(ctx):
await ctx.send("Hi")
client.run(("token"))
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "hello" is not found
如果您能告诉我哪里出了问题,我将不胜感激。
【问题讨论】:
-
您从未发出过名为
hello的命令。你做了这个函数,是的,但你没有把它附加到一个不和谐的命令上 -
@client.command()在最后两种情况下丢失。投票结束为拼写错误 -
那么我如何使它成为一个命令@12944qwerty
-
您在创建
clear时发出了命令。复制您用于其他命令的装饰器。 -
@client.command 是装饰器吗?
标签: python discord discord.py