1
Fork 0
mirror of https://github.com/Steffo99/greed.git synced 2024-10-16 13:47:27 +00:00

Small generic improvements

This commit is contained in:
Steffo 2018-05-30 11:46:18 +02:00
parent e49b2b7f00
commit 23ccd71581
3 changed files with 9 additions and 4 deletions

View file

@ -4,11 +4,15 @@ import strings
import worker
import configloader
import utils
import threading
def main():
"""The core code of the program. Should be run only in the main process!"""
# Rename the main thread for presentation purposes
threading.current_thread().name = "Core"
# Create a bot instance
bot = utils.DuckBot(configloader.config["Telegram"]["token"])

View file

@ -56,9 +56,10 @@ csv_caption = "E' stato generato un 📄 file .csv contenente tutte le transazio
# Conversation: the start command was sent and the bot should welcome the user
conversation_after_start = "Ciao!\n" \
"Benvenuto su greed!\n" \
"Quella che vedi qui è la versione 🅰️ <b>Alpha</b> del software.\n" \
"Pertanto, funzioni potranno essere aggiunte o rimosse in qualsiasi momento," \
" e l'interfaccia utente potrebbe essere incompleta."
"Quella che vedi qui è la versione 🅱️ <b>Beta</b> del software.\n" \
"E' completamente utilizzabile, ma è possibile che siano ancora presenti alcuni bug.\n" \
"Se li trovate, potete collaborare con gli sviluppatori per risolverli descrivendo cosa è" \
"successo a https://github.com/Steffo99/greed/issues."
# Conversation: to send an inline keyboard you need to send a message with it
conversation_open_user_menu = "Cosa vorresti fare?\n" \

View file

@ -32,7 +32,7 @@ class ChatWorker(threading.Thread):
def __init__(self, bot: utils.DuckBot, chat: telegram.Chat, *args, **kwargs):
# Initialize the thread
super().__init__(name=f"ChatThread {chat.first_name}", *args, **kwargs)
super().__init__(name=f"Worker {chat.id}", *args, **kwargs)
# Store the bot and chat info inside the class
self.bot: utils.DuckBot = bot
self.chat: telegram.Chat = chat