【发布时间】:2021-08-29 01:05:47
【问题描述】:
我最近决定学习如何使用 discord.py 命令,但我在添加命令时遇到了一些麻烦。无论我将命令更改为什么,当我尝试添加它时它总是会给出相同的错误:
discord.ext.commands.errors.CommandRegistrationError: The command hellothisisacommand is already an existing command or alias.
问题是,显然不是,而且无论我将命令更改为什么,它总是会出现此错误。这可能是什么原因造成的?代码如下。
import discord
from discord.ext import commands
import os
intents = discord.Intents.default()
intents.members = True
intents.presences = True
client = discord.Client()
bot = commands.Bot(command_prefix = '/')
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@bot.command()
async def hellothisisacommand(ctx):
await print(True)
bot.add_command(hellothisisacommand)
client.run('token')
【问题讨论】:
标签: python discord.py