Read out vote results directly

This commit is contained in:
gpkvt 2022-08-13 08:42:58 +02:00
parent 2714afc074
commit 053796ffdd

12
tts.py
View file

@ -208,7 +208,7 @@ class IRC:
self.sendmsg(conf['IRC_CHANNEL'], "@chat", conf['MESSAGE']['VOTEEND'])
self.sendmsg(conf['IRC_CHANNEL'], "*", conf['MESSAGE']['VOTENOBODY'])
msg = {
raw_msg = {
"TTS": True,
"msg": conf['MESSAGE']['VOTENOBODY'],
"badges": True,
@ -219,7 +219,8 @@ class IRC:
"queuetime": datetime.datetime.now(),
"timestamp": str(time.time_ns())
}
msg_queue_raw.append(msg)
msg_queue[raw_msg['timestamp']] = [raw_msg['user'], raw_msg['msg']]
logging.info('The result is: %s', conf['MESSAGE']['VOTENOBODY'])
logging.debug('Votemsg: %s', msg)
@ -234,9 +235,9 @@ class IRC:
logging.debug(count)
msg = {
raw_msg = {
"TTS": True,
"msg": conf['MESSAGE']['VOTERESULT'] +" "+ str(count[0]),
"msg": conf['MESSAGE']['VOTERESULT'] +" "+ str(count[0][0].replace('#','')),
"badges": True,
"subscriber": True,
"msgid": True,
@ -245,7 +246,8 @@ class IRC:
"queuetime": datetime.datetime.now(),
"timestamp": str(time.time_ns())
}
msg_queue_raw.append(msg)
msg_queue[raw_msg['timestamp']] = [raw_msg['user'], raw_msg['msg']]
logging.info('The result is: %s', conf['MESSAGE']['VOTERESULT'] +" "+ str(count[0]))
logging.debug('Votemsg: %s', msg)