From 849a0a08430289acecc9f9ab071128342bd47952 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 13 May 2021 17:58:34 +0200 Subject: [PATCH] Only fetch changelog, when auto-updates are enabled Fixes: #268 --- configuration.example.ini | 2 +- mumbleBot.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configuration.example.ini b/configuration.example.ini index f969f71..4f683de 100644 --- a/configuration.example.ini +++ b/configuration.example.ini @@ -79,7 +79,7 @@ port = 64738 # 'download_attempts': how many times the bot will try to download an item #download_attempts = 2 -# 'auto_check_update': check for updates every time the bot starts +# 'auto_check_update': check for updates every time the bot starts, post the changelog after an update was applied #auto_check_update = True #pip3_path = venv/bin/pip diff --git a/mumbleBot.py b/mumbleBot.py index 1a46c2a..98f18a7 100644 --- a/mumbleBot.py +++ b/mumbleBot.py @@ -190,8 +190,9 @@ def check_update(): last_startup_version = var.db.get("bot", "version", fallback=None) if not last_startup_version or version.parse(last_startup_version) < version.parse(self.version): var.db.set("bot", "version", self.version) - changelog = util.fetch_changelog() - self.send_channel_msg(tr("update_successful", version=self.version, changelog=changelog)) + if var.config.getboolean("bot", "auto_check_update"): + changelog = util.fetch_changelog() + self.send_channel_msg(tr("update_successful", version=self.version, changelog=changelog)) # Set the CTRL+C shortcut def ctrl_caught(self, signal, frame):