From fde9c7d37d25a21dd98af0374a3c9441f0b1b954 Mon Sep 17 00:00:00 2001 From: gpkvt Date: Mon, 12 Sep 2022 18:22:08 +0000 Subject: [PATCH 1/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c645f3..0d23fdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -All notable changes to this project will be documented in this file. If there is a `Changed` section please read carefully, as this often means that you will need to adapt your `config.yml`, otherwise the bot might fail to start. +All notable changes to this project will be documented in this file. If there is a `Changed` section please read carefully, as this often means that you will need to adapt your `config.yml`. ## [1.7.0] - 2022-08-27 From c628b35d295d0a1d08be0485f85ee4384fcdd0a4 Mon Sep 17 00:00:00 2001 From: gpkvt Date: Sun, 2 Oct 2022 00:26:30 +0000 Subject: [PATCH 2/2] Update tts.py, CHANGELOG.md --- CHANGELOG.md | 6 ++++++ tts.py | 51 ++++++++++++++++++++------------------------------- 2 files changed, 26 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d23fdb..c4cfcc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. If there is a `Changed` section please read carefully, as this often means that you will need to adapt your `config.yml`. +## [1.7.1] - 2022-10-02 + +### Fixed 1.7.1 + +* Allow usage of `!sq` command when TTS is disabled + ## [1.7.0] - 2022-08-27 ### Added 1.7.0 diff --git a/tts.py b/tts.py index b4f0ab7..28eda85 100644 --- a/tts.py +++ b/tts.py @@ -764,38 +764,27 @@ class IRC: if not isinstance(quote, str): quote = quote.decode('utf-8') - if IRC.check_tts_disabled(self, user): - logging.info('TTS is disabled') - elif IRC.check_user_denied(self, user): - logging.info('User is not allowed to use TTS') - elif IRC.check_subonly(self, tags): - logging.info('TTS is sub-only') - elif IRC.check_modonly(self, tags): - logging.info('TTS is mod-only') - elif IRC.check_whitelist(self, user): - logging.info('User is not on whitelist') - else: - logging.info('Sending quote to TTS') - logging.debug("Quote: %s", quote) - self.sendmsg( - CONF['IRC_CHANNEL'], - "", - quote - ) + logging.info('Sending quote to TTS') + logging.debug("Quote: %s", quote) + self.sendmsg( + CONF['IRC_CHANNEL'], + "", + quote + ) - message = quote.rsplit('(', 1)[0] - raw_msg = { - "TTS": True, - "msg": message, - "badges": True, - "subscriber": True, - "msgid": True, - "user": CONF['IRC_USERNAME'], - "length": CONF['IRC_TTS_LEN'], - "queuetime": datetime.datetime.now(), - "timestamp": str(time.time_ns()) - } - msg_queue[raw_msg['timestamp']] = [raw_msg['user'], raw_msg['msg']] + message = quote.rsplit('(', 1)[0] + raw_msg = { + "TTS": True, + "msg": message, + "badges": True, + "subscriber": True, + "msgid": True, + "user": CONF['IRC_USERNAME'], + "length": CONF['IRC_TTS_LEN'], + "queuetime": datetime.datetime.now(), + "timestamp": str(time.time_ns()) + } + msg_queue[raw_msg['timestamp']] = [raw_msg['user'], raw_msg['msg']] return True