@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)
await ctx.channel.send("**На каждый вопрос дается 60 секунд на ответ!**")
await ctx.channel.send(f"Наберите название ивента")
try:
event = await self.bot.wait_for('message', check=check, timeout = 60.0)
except asyncio.TimeoutError:
await ctx.channel.send('TimeoutError. Повторите команду')
# дальше по аналогии