From 4c5e51ac3736a3e0f01bb70cf5ee75ad71fc5862 Mon Sep 17 00:00:00 2001 From: Shou Date: Tue, 27 Jul 2021 14:22:50 +0200 Subject: [PATCH] Made it so RE on/off status is communicated to the bot more frequently --- CHANGELOG.md | 1 + pesterchum.py | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 020c51d..dd2f3ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Fixed - Crash when opening invite-only memo. (My bad-) +- Random encounters occasionally not being disabled when switched off. (RE bot is now updated after connect and on profile switch.) ### Changed - Honk emote now only triggers when typing ':honk:' instead of on every 'honk'. diff --git a/pesterchum.py b/pesterchum.py index 80cec58..1405fdf 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -1419,6 +1419,16 @@ class PesterWindow(MovingWindow): self.chooseServerAskedToReset = False self.chooseServer() + + # Update RE bot + try: + if self.userprofile.getRandom(): + code = "+" + else: + code = "-" + self.sendNotice.emit(code, RANDNICK) + except: + logging.warning("No randomEncounter set in userconfig?") @QtCore.pyqtSlot(QString, QString) def updateMsg(self, ver, url): @@ -2995,7 +3005,16 @@ class PesterWindow(MovingWindow): if ret == QtWidgets.QMessageBox.Cancel: return self.changeProfile() - @QtCore.pyqtSlot() + # Update RE bot + try: + if self.userprofile.getRandom(): + code = "+" + else: + code = "-" + self.sendNotice.emit(code, RANDNICK) + except: + logging.warning("No randomEncounter set in userconfig?") + def aboutPesterchum(self): if hasattr(self, 'aboutwindow') and self.aboutwindow: return