From 1e8d64059d39ef3565342e7c135590764de4f8f8 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 28 Nov 2018 21:00:12 +0100 Subject: [PATCH 1/4] Fix bug --- discordbot.py | 3 ++- template_config.ini | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/discordbot.py b/discordbot.py index d4fbb07e..c64aca75 100644 --- a/discordbot.py +++ b/discordbot.py @@ -54,6 +54,7 @@ loop = asyncio.get_event_loop() # Init the config reader config = configparser.ConfigParser() config.read("config.ini") +config = dict(config) # Radio messages radio_messages = ["https://www.youtube.com/watch?v=3-yeK1Ck4yk", @@ -560,7 +561,7 @@ class RoyalDiscordBot(discord.Client): now_playing = self.video_queue[0] try: audio_source = now_playing.create_audio_source() - except FileNotDownloadedError: + except errors.FileNotDownloadedError: continue logger.info(f"Started playing {repr(now_playing)}.") voice_client.play(audio_source) diff --git a/template_config.ini b/template_config.ini index 8d7a40ff..730a6379 100644 --- a/template_config.ini +++ b/template_config.ini @@ -16,6 +16,7 @@ server_id = main_channel = afk_timer = 10 radio_messages_every = 5 +activityreport_sample_time = 600 [Telegram] bot_token = @@ -37,6 +38,3 @@ client_id = client_secret = username = password = - -[Events] -halloween = 0 \ No newline at end of file From a57b2e925c44b0d26d9c23300a95f384b5a4f86a Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 28 Nov 2018 23:11:14 +0100 Subject: [PATCH 2/4] solo per proto --- discordbot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discordbot.py b/discordbot.py index c64aca75..1194e3df 100644 --- a/discordbot.py +++ b/discordbot.py @@ -101,7 +101,8 @@ song_special_messages = { "police academy": ":arrow_forward: {song} - freedom.png", "super smash bros. ultimate": ":arrow_forward: Re-awaken the undying light with {song}!", "powerwolf": ":arrow_forward: Spaggia, ma non ti sei un po' stancato di {song}?", - "eurobeat": ":arrow_forward: Nemesis approva la scelta di {song}. Ben fatto, amico." + "eurobeat": ":arrow_forward: Nemesis approva la scelta di {song}. Ben fatto, amico.", + "k/da": ":arrow_forward: You won a free deportation to Korea! Now playing: {song}." } # FFmpeg settings From 887df13b2eb9dd168f664138fd15ddd3d27b495d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 4 Dec 2018 10:38:00 +0000 Subject: [PATCH 3/4] Remove now useless error --- telegrambot.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/telegrambot.py b/telegrambot.py index 1ef3e81e..9cf877f1 100644 --- a/telegrambot.py +++ b/telegrambot.py @@ -199,8 +199,7 @@ def cmd_diario(bot: Bot, update: Update): saver = author except IndexError: if update.message.reply_to_message is None: - bot.send_message(update.message.chat.id, f"⚠ Non hai specificato cosa aggiungere al diario! Puoi rispondere `/diario@royalgamesbot` al messaggio che vuoi salvare nel diario oppure scrivere `/diario@royalgamesbot ` per aggiungere quel messaggio nel diario.\n" - f"Se l'hai fatto, e continua a comparire questo errore, allora Telegram è stupido e non mi vuole far vedere il messaggio a cui hai risposto.", parse_mode="Markdown") + bot.send_message(update.message.chat.id, f"⚠ Non hai specificato cosa aggiungere al diario! Puoi rispondere `/diario@royalgamesbot` al messaggio che vuoi salvare nel diario oppure scrivere `/diario@royalgamesbot ` per aggiungere quel messaggio nel diario.", parse_mode="Markdown") return text = update.message.reply_to_message.text author = session.query(db.Telegram).filter_by(telegram_id=update.message.reply_to_message.from_user.id).one_or_none() From 7169c416b815bf704ad8dc378200f37ebc8290a6 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 4 Dec 2018 10:40:25 +0000 Subject: [PATCH 4/4] 3 characters --- telegrambot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegrambot.py b/telegrambot.py index 9cf877f1..5aaf187a 100644 --- a/telegrambot.py +++ b/telegrambot.py @@ -257,7 +257,7 @@ def cmd_vote(bot: Bot, update: Update): parse_mode="HTML") vote.message_id = message.message_id session.commit() - except Exception as e: + except Exception: raise finally: session.close()