diff --git a/bot.py b/bot.py
index 732f4e1..7aea760 100755
--- a/bot.py
+++ b/bot.py
@@ -98,11 +98,11 @@ def add_name(bot, update, player, type, qid):
def add_diff(bot, update, player, type, qid):
message = update.message.text.lower()
chat_id = update.message.chat_id
- if message == "low" or message == "๐ low":
+ if message in ["low", "๐ low", "l"]:
diff = 1
- elif message == "medium" or message == "๐ medium":
+ elif message in ["medium", "๐ medium", "m"]:
diff = 2
- elif message == "high" or message == "๐ high":
+ elif message in ["high", "๐ high", "h"]:
diff = 3
else:
bot.send_message(chat_id=chat_id, text="Invalid Option")
@@ -129,11 +129,11 @@ def add_diff(bot, update, player, type, qid):
def add_imp(bot, update, player, type, qid):
message = update.message.text.lower()
chat_id = update.message.chat_id
- if message == "low" or message == "๐น low":
+ if message in ["low", "๐น low", "l"]:
imp = 1
- elif message == "medium" or message == "๐ธ medium":
+ elif message in ["medium", "๐ธ medium", "m"]:
imp = 2
- elif message == "high" or message == "๐บ high":
+ elif message in ["high", "๐บ high", "h"]:
imp = 3
else:
bot.send_message(chat_id=chat_id, text="Invalid Option")
@@ -305,11 +305,11 @@ def edit_quest(bot, update, player, qid, target, type):
text = "โ๏ธ Updated Name"
elif target == "imp":
message = message.lower()
- if message == "low" or message == "๐น low":
+ if message in ["low", "๐น low", "l"]:
x.imp = 1
- elif message == "medium" or message == "๐ธ medium":
+ elif message in ["medium", "๐ธ medium", "m"]:
x.imp = 2
- elif message == "high" or message == "๐บ high":
+ elif message in ["high", "๐บ high", "h"]:
x.imp = 3
else:
bot.send_message(chat_id=chat_id, text="Invalid Option")
@@ -317,11 +317,11 @@ def edit_quest(bot, update, player, qid, target, type):
text = "โ๏ธ Updated Priority"
elif target == "diff":
message = message.lower()
- if message == "low" or message == "๐ low":
+ if message in ["low", "๐ low", "l"]:
x.diff = 1
- elif message == "medium" or message == "๐ medium":
+ elif message in ["medium", "๐ medium", "m"]:
x.diff = 2
- elif message == "high" or message == "๐ high":
+ elif message in ["high", "๐ high", "h"]:
x.diff = 3
else:
bot.send_message(chat_id=chat_id, text="Invalid Option")
@@ -466,23 +466,21 @@ def message_handling(bot, update, db):
# rt: Remove token
if state["state"] == "none":
- if text == "add quest" or text == "โ๏ธ add quest":
+ if text in ["add quest", "โ๏ธ add quest", "aq"]:
add_quest(bot, update, player)
- elif text == "add side quest" or text == "๐ฏ add side quest":
+ elif text in ["add side quest", "๐ฏ add side quest", "asq"]:
add_quest(bot, update, player, "side_quest")
- elif text == "list quests" or text == "๐ list quests":
+ elif text in ["list quests", "๐ list quests", "lq"]:
list_quests(bot, update, player, "quest")
- elif text == "list side quests" or text == "๐ list side quests":
+ elif text in ["list side quests", "๐ list side quests", "lsq"]:
list_quests(bot, update, player, "side_quest")
- elif text == "tokens" or text == "๐ tokens":
+ elif text in ["tokens", "๐ tokens", "t"]:
tokens(bot, update)
- elif text == "list tokens" or text == "๐ list tokens":
+ elif text in ["list tokens", "๐ list tokens", "lt"]:
list_tokens(bot, update, player)
-
- elif text == "generate token" or text == "๐ generate token":
+ elif text in ["generate token", "๐ generate token", "gt"]:
add_token(bot, update, player)
-
- elif text == "delete token" or text == "๐งน delete token":
+ elif text in ["delete token", "๐งน delete token", "dt"]:
delete_token(bot, update, player)
else:
@@ -508,32 +506,32 @@ def message_handling(bot, update, db):
add_imp(bot, update, player, "side_quest", state["extra"])
elif state["state"] == "eq":
- if text == "back" or text == "โฌ
๏ธ back":
+ if text in ["back", "โฌ
๏ธ back", "b"]:
player.set_state('none', 0)
send_status(bot, update, player)
- elif text == "mark as done" or text == "โ
mark as done":
+ elif text in ["mark as done", "โ
mark as done", "mad"]:
mark_as_done(bot, update, player, state["extra"], "quest")
- elif text == "edit name" or text == "๐ edit name":
+ elif text in ["edit name", "๐ edit name", "en"]:
player.set_state('eqn', state["extra"])
text = "What shall the new name of the Quest be?"
reply_markup = telegram.ReplyKeyboardRemove()
bot.send_message(chat_id=player.CHAT_ID, text=text,
reply_markup=reply_markup)
- elif text == "change priority" or text == "โ ๏ธ change priority":
+ elif text in ["change priority", "โ ๏ธ change priority", "cp"]:
player.set_state('eqi', state["extra"])
text = "How important is it?"
custom_keyboard = button_groups.importance
reply_markup = telegram.ReplyKeyboardMarkup(custom_keyboard)
bot.send_message(chat_id=player.CHAT_ID, text=text,
reply_markup=reply_markup)
- elif text == "change difficulty" or text == "๐ change difficulty":
+ elif text in ["change difficulty", "๐ change difficulty", "cd"]:
player.set_state('eqd', state["extra"])
text = "How difficult is it?"
custom_keyboard = button_groups.difficulty
reply_markup = telegram.ReplyKeyboardMarkup(custom_keyboard)
bot.send_message(chat_id=player.CHAT_ID, text=text,
reply_markup=reply_markup)
- elif text == "delete quest" or text == "๐ delete quest":
+ elif text in ["delete quest", "๐ delete ques", "dq"]:
quest = questable.get_quest(db, player.CHAT_ID, state["extra"])
quest.delete_from_db()
drop_state(bot, update, player)
@@ -545,32 +543,32 @@ def message_handling(bot, update, db):
send_status(bot, update, player)
elif state["state"] == "esq":
- if text == "back" or text == "โฌ
๏ธ back":
+ if text in ["back", "โฌ
๏ธ back", "b"]:
player.set_state('none', 0)
send_status(bot, update, player)
- elif text == "mark as done" or text == "โ
mark as done":
+ elif text in ["mark as done", "โ
mark as done", "mad"]:
mark_as_done(bot, update, player, state["extra"], "side_quest")
- elif text == "edit name" or text == "๐ edit name":
+ elif text in ["edit name", "๐ edit name", "en"]:
player.set_state('esqn', state["extra"])
text = "What shall the new name of the Side Quest be?"
reply_markup = telegram.ReplyKeyboardRemove()
bot.send_message(chat_id=player.CHAT_ID, text=text,
reply_markup=reply_markup)
- elif text == "change priority" or text == "โ ๏ธ change priority":
+ elif text in ["change priority", "โ ๏ธ change priority", "cp"]:
player.set_state('esqi', state["extra"])
text = "How important is it?"
custom_keyboard = button_groups.importance
reply_markup = telegram.ReplyKeyboardMarkup(custom_keyboard)
bot.send_message(chat_id=player.CHAT_ID, text=text,
reply_markup=reply_markup)
- elif text == "change difficulty" or text == "๐ change difficulty":
+ elif text in ["change difficulty", "๐ change difficulty", "cd"]:
player.set_state('esqd', state["extra"])
text = "How difficult is it?"
custom_keyboard = button_groups.difficulty
reply_markup = telegram.ReplyKeyboardMarkup(custom_keyboard)
bot.send_message(chat_id=player.CHAT_ID, text=text,
reply_markup=reply_markup)
- elif text == "delete side quest" or text == "๐ delete side quest":
+ elif text in ["delete side quest", "๐ delete side quest", "dsq"]:
sq = questable.get_side_quest(db, player.CHAT_ID, state["extra"])
sq.delete_from_db()
drop_state(bot, update, player)