Add random nicks on voice connection

This commit is contained in:
Edgar P. Burkhart 2024-06-10 19:26:06 +02:00
parent b63ee3a12a
commit 50f32a620f
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -28,6 +28,7 @@ aibot = AIBot(
intents = discord.Intents.default()
intents.members = True
intents.message_content = True
intents.voice_states = True
bot = discord.Bot(description=description, intents=intents)
@ -168,6 +169,12 @@ async def alea(ctx):
await ctx.respond(embed=embed)
@bot.listen("on_voice_state_update")
async def voice_random_nicks(member, before, after):
if before.channel is None and random.random() < 1 / 24:
await try_shuffle(member.guild)
@bot.slash_command(
name="indu", guild_ids=guild_ids, description="Poser une question à MistralAI"
)