@bot.event
async def on_slash_command_error(interaction: ApplicationCommandInteraction, error: Exception) -> None:
"""
The code in this event is executed every time a valid slash command catches an error
:param interaction: The slash command that failed executing.
:param error: The error that has been faced.
"""
pass
@client.event
async def on_voice_state_update(member, before, after):
# присоединение к каналу
if before.channel is None and after.channel is not None:
start_log(member.id, after.channel.id)
# покинул канал
elif before.channel is not None and after.channel is None:
end_log(member.id, before.channel.id)
# перешел в другой канал
elif before.channel is not None and after.channel is not None:
end_log(member.id, before.channel.id)
start_log(member.id, after.channel.id)
@commands.cooldown(1, 60, commands.BucketType.user)
async def idea(ctx,*, idea=None):
if is_admin(ctx.author): # подставить свой способ проверки
idea.reset_cooldown(ctx)
disnake.errors.InteractionTimedOut: Interaction took more than 3 seconds to be responded to. Please defer it using "interaction.response.defer" on the start of your command. Later you may send a response by editing the deferred message using "interaction.edit_original_message"
Note: This might also be caused by a misconfiguration in the components make sure you do not respond twice in case this is a component.