Compare commits

...

4 Commits

Author SHA1 Message Date
Ceda EI d2b70dacd8 Update README. 2019-05-21 16:27:47 +05:30
Ceda EI c5b7eba052 Update README. 2019-05-21 16:24:41 +05:30
Ceda EI 1cc0743061 Add client list in tokens. 2019-05-21 16:04:06 +05:30
Ceda EI 514117a079 Convert qid to int 2019-05-21 13:28:59 +05:30
3 changed files with 35 additions and 4 deletions

View File

@ -1,3 +1,30 @@
# Questable
A game-like To-Do List Telegram Bot
A game-like To-Do List Telegram Bot.
Source code for [Questable Bot](https://t.me/questable_bot) and the relevant
[API](https://api.questable.webionite.com/)
# Self Hosting
+ Clone the repository.
+ `git clone https://gitlab.com/questable/questable_bot.git`
+ `cd questable`
## Telegram Bot
+ Install the dependencies
+ `pip3 install python-telegram-bot`
+ Copy `sample.config.py` to `config.py` and edit it accordingly.
+ Run the bot
+ `python3 bot.py`
## Questable API Server
+ Install the dependencies
+ `pip3 install Flask`
+ Install `gunicorn`
+ `pip3 install gunicorn`
+ Run `gunicorn3 -b 127.0.0.1:5000 server:app`. Change port if you want to run
gunicorn on a different port.
+ Set up a reverse proxy from your webserver to `localhost:5000`.

8
bot.py
View File

@ -401,9 +401,13 @@ def tokens(bot, update):
reply_markup = telegram.ReplyKeyboardMarkup(custom_keyboard)
reply_text = ("Tokens are used to authenticate external "
"applications. This only provides access to "
"Questable data.")
"Questable data.\n"
"\nOfficial clients are:\n"
"[Questable CLI](https://gitlab.com/questable/questable-cli)"
)
bot.send_message(chat_id=update.message.chat_id, text=reply_text,
reply_markup=reply_markup)
reply_markup=reply_markup, parse_mode="markdown",
disable_web_page_preview=True)
def add_token(bot, update, player):

View File

@ -9,7 +9,7 @@ class base_quest():
self.DB = db
self.CHAT_ID = chat_id
self.name = name
self.QID = qid
self.QID = int(qid)
self.imp = imp
self.diff = diff
self.state = state