Add ls to list both quests and side quests
This commit is contained in:
parent
0a41d3d868
commit
0ab2fa5b6b
3
bot.py
3
bot.py
|
@ -482,6 +482,9 @@ def message_handling(bot, update, db):
|
||||||
add_token(bot, update, player)
|
add_token(bot, update, player)
|
||||||
elif text in ["delete token", "🧹 delete token", "dt"]:
|
elif text in ["delete token", "🧹 delete token", "dt"]:
|
||||||
delete_token(bot, update, player)
|
delete_token(bot, update, player)
|
||||||
|
elif text == "ls":
|
||||||
|
list_quests(bot, update, player, "side_quest")
|
||||||
|
list_quests(bot, update, player, "quest")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if update.message.chat.type == "private":
|
if update.message.chat.type == "private":
|
||||||
|
|
44
schema.sql
44
schema.sql
|
@ -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 quests(
|
||||||
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));
|
chat_id int NOT NULL,
|
||||||
CREATE TABLE IF NOT EXISTS points(chat_id int PRIMARY KEY, points int);
|
qid int NOT NULL,
|
||||||
CREATE TABLE IF NOT EXISTS state(chat_id int PRIMARY KEY, state varchar(10), extra varchar(10));
|
name varchar(255),
|
||||||
CREATE TABLE IF NOT EXISTS tokens(chat_id int, token varchar(36) PRIMARY KEY);
|
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
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in New Issue