Telegram bot for searching for relevant xkcd comics, inline.
git clone https://github.com/wojpawlik/xkcd-search-bot.git
cd xkcd-search-bot
# set some env variables, see below
npm install
npm start
docker build -t xkcd-search-bot https://github.com/wojpawlik/xkcd-search-bot.git
# set TELEGRAM_BOT_TOKEN env variable
# run interactively...
docker run -it --env TELEGRAM_BOT_TOKEN xkcd-search-bot
# ...or daemonize for production
docker run --detach --restart=always --memory="64M" --memory-swap="64M" --env TELEGRAM_BOT_TOKEN xkcd-search-bot
Configuration is done via environmental variables:
TELEGRAM_BOT_TOKEN
(required) – token, obtain it from @BotFather.URL
(optional) – URL to set webhook to.XKCD_CACHE_TIME
(optional) – determines how long Telegram should cache answers to inline queries, time in seconds. Defaults to 0 seconds ifprocess.env.NODE_ENV === 'development'
, 1 hour otherwise.CONTACT_URL
(optional) – url to which the "Contact author" button points to.