Skip to content
Snippets Groups Projects
Commit 4eec8ed2 authored by Gianluca OBERREIT's avatar Gianluca OBERREIT
Browse files

Make Gemhandler static

parent 763230c1
No related branches found
No related tags found
No related merge requests found
......@@ -36,21 +36,22 @@ logger = logging.getLogger(__name__)
class GemHandler:
def __init__(self):
self.EXIT = 0
self.handler = ConversationHandler(
entry_points=[MessageHandler(filters.Regex(re.compile(r'gems', re.IGNORECASE)), self.gems)],
states={},
fallbacks=[],
map_to_parent={
self.EXIT: self.EXIT
}
)
EXIT = 0
async def gems(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
@staticmethod
async def gems(update: Update, context: ContextTypes.DEFAULT_TYPE):
"""Tell them a little bit about gems, in the future it will give more options but for that I'll have to ask Gaia and Adrien about IW"""
for message in texts["gems"]:
await context.bot.send_chat_action(chat_id=update.effective_chat.id, action='typing')
time.sleep(len(message)/140)
await context.bot.send_message(chat_id=update.effective_chat.id, text=message)
return self.EXIT
return GemHandler.EXIT
handler = ConversationHandler(
entry_points=[MessageHandler(filters.Regex(re.compile(r'gems', re.IGNORECASE)), gems)],
states={},
fallbacks=[],
map_to_parent={
EXIT: EXIT
}
)
from . import config
from . import db
from . import gc
from version_check import Vcheck
from load_env_vars import VARS
from .version_check import Vcheck
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment