Skip to content
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.

wojpawlik/xkcd-search-bot

Repository files navigation

Telegram bot for searching for relevant xkcd comics, inline.

Setup

git clone https://github.com/wojpawlik/xkcd-search-bot.git
cd xkcd-search-bot
# set some env variables, see below
npm install
npm start

Setup with Docker

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 if process.env.NODE_ENV === 'development', 1 hour otherwise.
  • CONTACT_URL (optional) – url to which the "Contact author" button points to.

About

Telegram bot for searching for revelant xkcd comics, inline.

Resources

Stars

Watchers

Forks

Packages

No packages published