• Из за чего пишет "Неизвестная интеграция"?

    @Ropb4ik Автор вопроса
    fenrir,
    @commands.slash_command(name='join', description='Присоединиться к голосовому каналу.', guild_only=True)
        async def _join(self, interaction: disnake.ApplicationCommandInteraction):
            guild_id = interaction.guild_id
            voice_state = self.get_voice_state(guild_id)
    
            await interaction.response.send_message(f"Бот присоединился к голосовому каналу.", ephemeral=True)
    
            if interaction.author.voice is None or interaction.author.voice.channel is None:
                await interaction.response.send_message("Вы должны быть в голосовом канале, чтобы бот мог присоединиться.", ephemeral=True)
                return
    
            destination = interaction.author.voice.channel
            if voice_state.voice:
                await voice_state.voice.move_to(destination)
                return
    
            voice_state.voice = await destination.connect()
            voice_state.audio_player = self.bot.loop.create_task(voice_state.audio_player_task())
    Написано
  • Как исправить ошибку "is not a valid parameter annotation" слэш-команды в когах?

    @Ropb4ik Автор вопроса
    Пробовал, но inter там не используется, так же ты не указал ctx.

    Если сделать так:
    async def _play(self, ctx, inter: disnake.ApplicationCommandInteraction,  *, search: str):

    То будет такая ошибка:
    Traceback (most recent call last):
    File "C:\Users\User\Desktop\AgainstEvil\cogs\music.py", line 248, in
    class Music(commands.Cog):
    File "C:\Users\User\Desktop\AgainstEvil\cogs\music.py", line 383, in Music
    @commands.slash_command(name='play', description='Playing Music')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\disnake\ext\commands\slash_core.py", line 825, in decorator
    return InvokableSlashCommand(
    ^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\disnake\ext\commands\slash_core.py", line 452, in __init__
    options = expand_params(self)
    ^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\disnake\ext\commands\params.py", line 1094, in expand_params
    _, inter_param, params, injections = collect_params(command.callback, sig)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\disnake\ext\commands\params.py", line 989, in collect_params
    raise TypeError(
    TypeError: Found two candidates for the interaction parameter in : ctx and inter

    Если сделать так:
    async def _play(self, ctx: disnake.ApplicationCommandInteraction, *, search: str):

    То будет такая ошибка:

    Ignoring exception in on_application_command
    Traceback (most recent call last):
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\disnake\client.py", line 703, in _run_event
    await coro(*args, **kwargs)
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\disnake\ext\commands\interaction_bot_base.py", line 1386, in on_application_command
    await self.process_application_commands(interaction)
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\disnake\ext\commands\interaction_bot_base.py", line 1378, in process_application_commands
    await app_command.invoke(interaction)
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\disnake\ext\commands\slash_core.py", line 717, in invoke
    await self.prepare(inter)
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\disnake\ext\commands\base_core.py", line 322, in prepare
    await self.call_before_hooks(inter)
    File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\disnake\ext\commands\base_core.py", line 463, in call_before_hooks
    await self._before_invoke(instance, inter) # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\User\Desktop\AgainstEvil\cogs\music.py", line 406, in ensure_voice_state
    if ctx.voice_client:
    ^^^^^^^^^^^^^^^^
    AttributeError: 'ApplicationCommandInteraction' object has no attribute 'voice_client'
    Написано
  • Как убрать текст: Hey there! Now that a command has been ran, you should be able to get your Active Developer badge on?

    @Ropb4ik Автор вопроса
    fenrir, Бот написан мною, смотрите, когда делаешь команду через @bot.slash_command, бот отвечает типо что бы получить бейдж активного разработчика, хотя он у меня уже есть, а так у меня команды написано через @bot.command()
    Написано