import discord
from discord.ext import commands
from discord import app_commands
guild = discord.Object(id=Скрыл)
class slashcom(discord.Client):
def __init__(self):
super().__init__(intents=discord.Intents.default())
self.synced = False
async def on_ready(self):
await self.wait_until_ready()
if not self.synced:
await tree.sync(guild=guild)
self.synced = True
print("By Svyatskiy")
bot = slashcom()
tree = app_commands.CommandTree(bot)
@tree.command(name="reload", description="3", guild=guild)
@commands.is_owner()
async def reload(ctx):
await ctx.send("111")
await bot.logout()
bot.run("Токен скрыл")
Ошибка:
discord.app_commands.errors.CommandInvokeError: Command 'reload' raised an exception: AttributeError: 'Interaction' object has no attribute 'send'