@DiZiNnEs
I love to program =)

Почему не работает ban/kick в discord.py?

Привет, есть код:
spoiler
import discord
import random
import json


from discord.ext import commands


client = commands.Bot(command_prefix = '.')
#client = discord.Client()


@client.event
async def on_ready():
    print('We have logged in as {0.user}'.format(client))


@client.event
async def on_message(message,):
    if message.content.find('$ph') != -1:
        random1 = random.randint(1, 10)
        print(random1)
        await message.channel.send(file=discord.File(f'png/{random1}.jpg'))


@client.command()
async def kick(ctx, member : discord.Member, *, reason=None):
    await member.kick(reason=reason)


@client.command()
async def ban(ctx, member : discord.Member, *, reason=None):
    await member.ban(reason=reason)


client.run('HERE TOKEN')


Не работают команды:
.ban @Name
.kick @Name

Ошибок нет. Хотя у бота есть права на бан/кик, прошу помочь
  • Вопрос задан
  • 1453 просмотра
Решения вопроса 1
@DiZiNnEs Автор вопроса
I love to program =)
Проблема решена, нужно лишь убрать вот этот код:
@client.event
async def on_message(message,):
    if message.content.find('$ph') != -1:
        random1 = random.randint(1, 10)
        print(random1)
        await message.channel.send(file=discord.File(f'png/{random1}.jpg'))
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы