From f95f1f43f1dac6a34ee59fa7cfbca56741aaa877 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 20 Nov 2017 10:49:58 +0100 Subject: [PATCH] select error channel in config --- discordbot.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/discordbot.py b/discordbot.py index 1cd84b77..50407d1d 100644 --- a/discordbot.py +++ b/discordbot.py @@ -7,7 +7,6 @@ import sys import db import errors import youtube_dl -import os # Init the event loop import asyncio @@ -109,7 +108,7 @@ async def find_user(user: discord.User): async def on_error(event, *args, **kwargs): type, exception, traceback = sys.exc_info() try: - await client.send_message(client.get_channel("368447084518572034"), f"☢️ ERRORE CRITICO NELL'EVENTO `{event}`\n" + await client.send_message(client.get_channel(config["Discord"]["main_channel"]), f"☢️ ERRORE CRITICO NELL'EVENTO `{event}`\n" f"Il bot si è chiuso e si dovrebbe riavviare entro qualche minuto.\n\n" f"Dettagli dell'errore:\n" f"```python\n" @@ -340,9 +339,9 @@ async def update_users_pipe(users_connection): async def update_music_queue(): await client.wait_until_ready() + global voice_player + global voice_playing while True: - global voice_player - global voice_playing # Wait until there is nothing playing if voice_client is not None and voice_player is not None and (voice_player.is_playing() and not voice_player.is_done()): await asyncio.sleep(1)