class IDEAmodal(disnake.ui.Modal):
def __init__(self):
components = [
disnake.ui.TextInput(
label = 'Идея',
placeholder = 'Напишите идею',
custom_id = 'идея',
style = TextInputStyle.long
)
]
super().__init__(
title = 'Отправка идеи',
custom_id = 'титл',
components = components
)
async def callback(self, inter: disnake.CommandInteraction):
idea = cursor.execute("SELECT id_ideas FROM ideas WHERE id = {}".format(inter.guild.id))
idea2 = cursor.fetchone()
arg = inter.text_values['идея']
for row in idea2:
chann = int(row)
channel = self.bot.get_channel(chann)
embed = disnake.Embed(colour = 0x2F3136)
embed.set_author(name = f'Участник {inter.author}', icon_url = inter.author.avatar)
embed.add_field(name = 'Отправил идею', value = f'Идея: **{arg}**')
await channel.send(embed = embed, view = IDEAbuttons())
await inter.send('Идея отправлена!', ephemeral = True)
Когда пытаюсь использовать get_channel в модальном окне, то выбивает ошибку: AttributiveError: 'IDEAmodal' object has no attributive 'bot'