Add ls to list both quests and side quests

This commit is contained in:
Ceda EI 2019-05-11 12:29:21 +05:30
parent 0a41d3d868
commit 0ab2fa5b6b
2 changed files with 42 additions and 5 deletions

3
bot.py
View File

@ -482,6 +482,9 @@ def message_handling(bot, update, db):
add_token(bot, update, player)
elif text in ["delete token", "🧹 delete token", "dt"]:
delete_token(bot, update, player)
elif text == "ls":
list_quests(bot, update, player, "side_quest")
list_quests(bot, update, player, "quest")
else:
if update.message.chat.type == "private":

View File

@ -1,5 +1,39 @@
CREATE TABLE IF NOT EXISTS quests(chat_id int NOT NULL, qid int NOT NULL, name varchar(255), difficulty int, importance int, state int DEFAULT 0, UNIQUE(chat_id, qid));
CREATE TABLE IF NOT EXISTS side_quests(chat_id int NOT NULL, qid int NOT NULL, name varchar(255), difficulty int, importance int, state int DEFAULT 0, UNIQUE(chat_id, qid));
CREATE TABLE IF NOT EXISTS points(chat_id int PRIMARY KEY, points int);
CREATE TABLE IF NOT EXISTS state(chat_id int PRIMARY KEY, state varchar(10), extra varchar(10));
CREATE TABLE IF NOT EXISTS tokens(chat_id int, token varchar(36) PRIMARY KEY);
CREATE TABLE IF NOT EXISTS quests(
chat_id int NOT NULL,
qid int NOT NULL,
name varchar(255),
difficulty int,
importance int,
state int DEFAULT 0,
UNIQUE(chat_id, qid)
);
CREATE TABLE IF NOT EXISTS side_quests(
chat_id int NOT NULL,
qid int NOT NULL,
name varchar(255),
difficulty int,
importance int,
state int DEFAULT 0,
UNIQUE(chat_id, qid)
);
CREATE TABLE IF NOT EXISTS points(
chat_id int PRIMARY KEY,
points int
);
CREATE TABLE IF NOT EXISTS state(
chat_id int PRIMARY KEY,
state varchar(10),
extra varchar(10)
);
CREATE TABLE IF NOT EXISTS tokens(
chat_id int,
token varchar(36) PRIMARY KEY
);