Made it so RE on/off status is communicated to the bot more frequently

This commit is contained in:
Shou 2021-07-27 14:22:50 +02:00
parent 7aec4696c8
commit 4c5e51ac37
2 changed files with 21 additions and 1 deletions

View file

@ -9,6 +9,7 @@
### Fixed ### Fixed
- Crash when opening invite-only memo. (My bad-) - 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 ### Changed
- Honk emote now only triggers when typing ':honk:' instead of on every 'honk'. - Honk emote now only triggers when typing ':honk:' instead of on every 'honk'.

View file

@ -1419,6 +1419,16 @@ class PesterWindow(MovingWindow):
self.chooseServerAskedToReset = False self.chooseServerAskedToReset = False
self.chooseServer() 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) @QtCore.pyqtSlot(QString, QString)
def updateMsg(self, ver, url): def updateMsg(self, ver, url):
@ -2995,7 +3005,16 @@ class PesterWindow(MovingWindow):
if ret == QtWidgets.QMessageBox.Cancel: if ret == QtWidgets.QMessageBox.Cancel:
return return
self.changeProfile() 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): def aboutPesterchum(self):
if hasattr(self, 'aboutwindow') and self.aboutwindow: if hasattr(self, 'aboutwindow') and self.aboutwindow:
return return