Minor fixes

This commit is contained in:
gpkvt 2022-08-25 03:11:41 +02:00
parent e839923df4
commit 0972ebd6c2
3 changed files with 15 additions and 1 deletions

View File

@ -2,6 +2,13 @@
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.
## [1.6.1] - 2022-08-25
### Fixed 1.6.1
* Type Error during pick
* Improved command handling
## [1.6.0] - 2022-08-25
### Added 1.6.0

BIN
tts.exe

Binary file not shown.

9
tts.py
View File

@ -165,28 +165,34 @@ class IRC:
self.pickcount = self.pickcount + 1
self.pickme.append(user)
logging.debug("pickme %s added", user)
return
if msg.startswith('#') and self.quickvote_status is True:
logging.info('Quickvote: Cast detected')
self.pollcount += 1
self.poll[user] = msg.lower()
logging.debug("poll: %s", self.poll)
return
if msg.startswith('!tts'):
logging.info('!tts command detected')
self.Commands.tts(self, message, tags)
return
if msg.startswith('!addquote'):
logging.debug("!addquote command detected")
self.Commands.addquote(self, tags, msg)
return
if msg.startswith('!wiki'):
logging.debug("!wiki command detected")
self.Commands.wiki(self, tags, msg)
return
if msg.startswith('!smartquote') or msg.startswith('!sq'):
logging.debug("!smartquote command detected")
self.Commands.quote(self, tags, msg)
return
def get_tags(self, resp):
""" Strip tags from response """
@ -718,7 +724,7 @@ class IRC:
logging.debug("Got %s participats, wanted %s", self.pickcount, self.picknumber)
try:
if self.pickcount > self.picknumber:
if int(self.pickcount) > int(self.picknumber):
picks = random.sample(self.pickme, self.picknumber)
logging.info('Got more than the requested number of participants')
else:
@ -728,6 +734,7 @@ class IRC:
converted_picks = [str(element) for element in picks]
joined_picks = " ".join(converted_picks)
except: # pylint: disable=bare-except
logging.error("There was an eroor during picking.")
joined_picks = False
if joined_picks: