Discord бот не отвечает на сервере, только в личные сообщения

import discord
from discord.ext import commands

intents = discord.Intents.default()
intents.messages = True

bot = commands.Bot(command_prefix='/', intents=intents)

class MyCog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

@commands.Cog.listener()
async def on_ready(self):
        print('Я негр буду работать')

@commands.Cog.listener()
async def on_message(self, message):
        await self.bot.process_commands(message)

@bot.event
async def on_message(message):
    # Важно добавить эту строку для корректной обработки команд
    await bot.process_commands(message)

@bot.command()
async def ds(ctx):
    author = ctx.message.author
    await ctx.send('зайди пж https://discord.gg/prD7NX5k')
    with open("users.txt", 'a', encoding="utf-8") as file:
        file.write(str(author) + '\n')
    
@bot.command()
async def neger(ctx):
    author = ctx.message.author
    await ctx.send('я негер буду роботать')
    with open("users.txt", 'a', encoding="utf-8") as file:
        file.write (str(author)+ '\n')

@bot.command()
async def rusy(ctx):
    author = ctx.message.author
    await ctx.send('руся плачет у деда на каленках')
    with open("users.txt", 'a', encoding="utf-8") as file:
        file.write (str(author)+ '\n')

@bot.command()
async def vb(ctx):
    author = ctx.message.author
    await ctx.send(' https://cdn.discordapp.com/attachments/936254510463090738/1180863208072949892/121_20231203152754.png?ex=657ef790&is=656c8290&hm=73cadd6c87bbccd80e83f3945c8749be126d5a1477e30611369c21bac81983ed&')
    with open("users.txt", 'a', encoding="utf-8") as file:
        file.write (str(author)+ '\n')
            
@bot.command()
async def buy(ctx):
    author = ctx.message.author
    await ctx.send('Напиши мені в приватні повідомлення діскорду для того щоб купити. Нік: Sasha925kl')
    with open("users.txt", 'a', encoding="utf-8") as file:
        file.write (str(author)+ '\n')

@bot.command()
async def hello(ctx):
    author = ctx.message.author
    await ctx.send(f'Привіт,це бот для магазину для покупки вбаксів {author.mention}!')

    with open("users.txt", 'a', encoding="utf-8") as file:
        file.write (str(author)+ '\n')
        

bot.run(

Ответы (0 шт):