в обновлении 2.0 это выглядит как то так
import discord
from discord.ext import commands
from discord import app_commands
from discord import utils
intents = discord.Intents.all()
intents.members = True
client = commands.Bot(command_prefix='!', intents=intents)
class abot(discord.Client):
def __init__(self):
super().__init__(intents = discord.Intents.all())
self.synced = False
async def on_ready(self):
await tree.sync(guild = discord.Object(id=айди сервера))
self.synced = True
print('Бот в сети')
client = abot()
tree = app_commands.CommandTree(bot)
@tree.command(name='название команды', description='описание команды', guild=discord.Object(id=айди сервера))
async def ping(interaction: discord.Interaction):
await interaction.response.send_message('pong')
client.run(settings['TOKEN'])