Answer the question
In order to leave comments, you need to log in
Discord.py command not found, what's wrong?
Hello. At some point, all the commands in the bot stopped working.
When I try to write any command, I get an error that the command was not found.
I can't find the error in the code, please help me.
import discord
from discord.ext import commands
from discord.ext.commands import Bot
from discord_components import DiscordComponents, Button, ButtonStyle
intents = discord.Intents.all()
intents.typing = True
intents.presences = True
Bot: Bot = commands.Bot(command_prefix='.', intents=intents)
@Bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandNotFound):
await ctx.send(
embed=discord.Embed(description=f'{ctx.author.name}, команда не найдена!', colour=discord.Color.blue()))
@Bot.event
async def on_ready():
DiscordComponents(Bot)
print("Pokrenut")
@Bot.event
async def on_message(message):
await Bot.process_commands(message)
print(message.content)
@Bot.event
async def on_member_join(autor):
# channel = Bot.get_channel(685038866616680461)
await autor.send(
f"Привет <@!{autor.id}>, если ты решил вступить в клан Destiny 2, то в начале зайди в канал "
f"<#693850258995937350>, "
f"возьми роль Destiny 2, "
f"звтем вернись сюда и перейди в канал <#685429738038231050> и оставь там свою заявку.)")
@Bot.command()
async def test(ctx):
await ctx.send(
embed=discord.Embed(title="Пригласить в канал"),
components=[
Button(style=ButtonStyle.green, label="Вступить", emoji=":white_check_mark:"),
Button(style=ButtonStyle.red, label="Отказаться", emoji=":x:"),
Button(style=ButtonStyle.blue, label="Я подумаю", emoji=":question:"),
Button(style=ButtonStyle.URL, label="Канал", url="https://discord.gg/T3Rhg3xU"),
]
)
response = await Bot.wait_for("button_click")
if response.channel == ctx.channel:
if response.component.label == "Вступить":
await response.respond(content="Пркрасно")
else:
await response.respond(
embed=discord.Embed(title="Ты точно уверен?"),
components=[
Button(style=ButtonStyle.green, label="Да"),
Button(style=ButtonStyle.red, label="Нет"),
Button(style=ButtonStyle.blue, label="Я подумаю"),
]
)
@Bot.command()
async def send_m(ctx, member: discord.Member):
await member.send(f" Псс,{ctx.author.name}, сказал что {member.name} , хороший человек")
@Bot.command()
async def send_b(member: discord.Member):
await member.send(
f"Привет, {member} если ты решил вступить в клан Destiny 2, то в начале зайди в канал "
f"<#693850258995937350> и возьми роль Destiny 2, звтем перейди в канал <#685429738038231050> и оставь там "
f"свою заявку.)")
@Bot.command()
async def send_a(ctx):
await ctx.autor.send("ку-ку")
Ошибка:
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "test" is not found
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question