Browse Source

Add ls to list both quests and side quests

master
Ceda EI 3 years ago
parent
commit
0ab2fa5b6b
  1. 3
      bot.py
  2. 44
      schema.sql

3
bot.py

@ -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":

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 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
);

Loading…
Cancel
Save