Проблема с дискорд ботом для цуефа
import discord #Подключаем библиотеку
import random
from discord.ext import commands
from discord import Member
intents = discord.Intents.default() #Подключаем "Разрешения"
intents.message_content = True
bot = commands.Bot(command_prefix='/', intents=intents)
#С помощью декоратора создаём первую команду
@bot.command()
async def ping(ctx):
await ctx.send('pong')
@bot.command()
async def knb(ctx, choice: str):
choices = ['rock', 'paper', 'scissors']
# проверяем, что выбор пользователя является допустимым
if choice not in choices:
await ctx.send(f'Выберите: {", ".join(choices)}')
return
bot_choice = random.choice(choices)
# определяем победителя и отправляем результат в чат
if choice == 'rock' and bot_choice == 'scissors'\
or choice == 'paper' and bot_choice == 'rock' \
or choice == 'scissors' and bot_choice == 'paper': \
await ctx.send(f'{ctx.author.mention} победил! Бот выбрал {bot_choice}.')
elif choice == bot_choice:
await ctx.send(f'{ctx.author.mention} ничья! Бот выбрал {bot_choice}.')
else:
await ctx.send(f'{ctx.author.mention} проиграл! Бот выбрал {bot_choice}.')
Источник: Stack Overflow на русском