editing date format

This commit is contained in:
2025-11-27 11:16:36 +00:00
parent 5206de1840
commit 669e9c19fc
2 changed files with 25 additions and 9 deletions

15
main.py
View File

@@ -1,4 +1,5 @@
import discord
from discord.ext import tasks
from bot import Astro
import config
import help
@@ -6,4 +7,16 @@ import help
client = Astro(command_prefix=config.get_prefix(), intents=discord.Intents.all())
client.help_command = help.AstroHelp()
client.run(config.get_login("dev"))
@client.event
async def on_voice_state_update(member, before, after):
if member == client.user:
return #ignore self actions
# get the vc
voice_client = discord.utils.get(client.voice_clients, guild=member.guild)
# if the bot is the only connected member, leave
if voice_client and len(voice_client.channel.members) == 1:
await voice_client.disconnect()
client.run(config.get_login("live"))