AttributeError: 'NoneType' object has no attribute '_create_channel'
import disnake
from disnake.ext import commands
from config_file import settings
class CreateCommand(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.slash_command(pass_context=True)
async def createroom(self, ctx):
overwrites = {
}
await disnake.Guild.create_text_channel(self, name='secret', overwrites=overwrites)
await ctx.send('Канал создан')
def setup(bot: commands.Bot):
bot.add_cog(CreateCommand(bot))
Кусок кода между class
и def setup
я взял с сайта disnake API и чуть его отредактировал, чтобы на его основе сделать создание голосового канала после ввода команды. Но при запуске выдает ошибку
AttributeError: 'CreateCommand' object has no attribute '_create_channel'
Пробовал менять на class CreateCommand(commands.Cog, disnake.Guild._create_channel):
, но в этом случае вылазила ошибка
metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
Заранее буду благодарен за помощь