mirror of
https://github.com/kaaninchen/Gleiswechsel.git
synced 2026-09-17 16:52:47 +00:00
Fix: Discord reconnects abfangen
This commit is contained in:
@@ -16,12 +16,18 @@ async def change_status():
|
|||||||
status = random.choice(discord_status)
|
status = random.choice(discord_status)
|
||||||
await bot.change_presence(activity=discord.Game(name=f"{status} • /info"))
|
await bot.change_presence(activity=discord.Game(name=f"{status} • /info"))
|
||||||
|
|
||||||
|
_bot_initialized = False
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
|
global _bot_initialized
|
||||||
print(f"{bot.user} ist online")
|
print(f"{bot.user} ist online")
|
||||||
if not change_status.is_running():
|
if not change_status.is_running():
|
||||||
change_status.start()
|
change_status.start()
|
||||||
|
if not _bot_initialized:
|
||||||
|
_bot_initialized = True
|
||||||
await rename_vc(bot)
|
await rename_vc(bot)
|
||||||
|
else:
|
||||||
|
logger("Discord Reconnect, laufende Fahrt bleibt unangetastet")
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_application_command_error(ctx, error):
|
async def on_application_command_error(ctx, error):
|
||||||
|
|||||||
Reference in New Issue
Block a user