@1Andrey10

Не работает команда бота. Как исправить?

у бота есть 2 команды, 1 работает нормально, а 2 команду бот не видит
import discord
import random
import json
from discord.ext import commands
#
intents = discord.Intents.all()
#
file = open('config.json','r')
config = json.load(file)
#
bot = commands.Bot(config['prefix'], intents=discord.Intents.all())
#
@bot.command(name= 'ping')
async def ping(ctx):
    await ctx.send(f"{ctx.author.mention} pong!")
#
@bot.command(name='Random')
async def Random(ctx):
    await ctx.send(f"{ctx.author.mention} Ваше рандомное число: {random.randint(ctx)}!")
    await bot.process_commands(Random)

bot.run(config['token'])
  • Вопрос задан
  • 95 просмотров
Пригласить эксперта
Ответы на вопрос 1
@ShadowShow
А может нужно убрать @bot.command
Ответ написан
Комментировать
Ваш ответ на вопрос

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

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