Discord.py every command doesn’t work only on_message(message):

I know discord.py is kinda old but like 2 years ago i discovered this and decided to try code, kinda lost it and month ago retry coding

So i have this strange error beacose while i was codding tree comands i delete something and my commands stopped working

Spent 2 days to find solution but still the same

Here is part of code:

Main.py

`import datetime
import discord
from discord.ext import commands
from discord.ext.commands import has_permissions, MissingPermissions

from client import client
from fun import ocena
from moderation import delete, usun_kanal, dodaj_kanal
from spaming import ghost, spam, stop, spam_error


@client.command()
async def pfp(ctx, *, avamember: str = None):
    if avamember is None:
        await ctx.send("Musisz oznaczyć użytkownika!")
        return

    try:
        avamember = await commands.MemberConverter().convert(ctx, avamember)
    except commands.MemberNotFound:
        await ctx.send("Nie mogłem znaleźć tego użytkownika!")
        return

    user_avatar_url = avamember.display_avatar.url
    await ctx.send(f"**Awatar użytkownika** {avamember.name}: {user_avatar_url}")


@client.command()
async def ocenka(ctx):
.......

@client.event
async def on_command_error(ctx, error):
    if ctx.message.content.count('.') <= 1:
        if isinstance(error, commands.CommandNotFound):
            await ctx.send("Podano złą komende! ⚠️")


@client.event
async def on_message(message):
    if client.user.mentioned_in(message):
        await message.channel.send("Witaj! Aby zobaczyć liste moich komend wpisz `.help `! ")


@client.event
async def on_ready():
    await client.change_presence(status=discord.Status.idle,
                                 activity=discord.Game(name="Wpisz .help by zobaczyć co mogę dla ciebie zrobić!"))
    print('------------------------------')
    print('Pomyślnie zalogowano jako:')
    print("Nazwa bota:", client.user.name)
    print("Id bota:", client.user.id)
    print("Bot został uruchomiony", datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
    print('------------------------------')


client.run(`yk`)

client.py

import discord
from discord.ext import commands

intents = discord.Intents.all()
client = commands.Bot(command_prefix='.',intents=intents)
tree = client.tree

client.remove_command('help')

Rest of files are commands but pattern is basicly the same
from command import command

@client.command()
async def command(ctx):
await command(ctx)

I have twice @client.command() for command
First in main.py :

@client.command
async def delete(ctx, name):
    await delete(ctx, name)

Second in command.py:

@client.command()
@has_permissions(manage_messages=True)
async def delete(ctx, count):
    try:
        count = int(count)
        if (count < 0):
            await ctx.send("wrong number")
            return
    except ValueError:
        await ctx.send("error")
    else:
        await ctx.send(f"{count} messages")
        deleted_messages = await ctx.channel.purge(limit=count + 1)

I save this “method” or “schema” on some old youtube tutorial so i decided to do the same

ready for down arrows ????

New contributor

Kamil Konieczny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật