/rooboot-bot

Easy to setup Telegram bot made with Telegraf and hosted on Netlify. @Rooboot_bot

Primary LanguageTypeScriptMIT LicenseMIT

Rooboot - Telegram bot

https://telegram.me/Rooboot_bot Netlify GitHub Workflow Status GitHub Workflow Status

Built using Telegraf and hosted on Netlify.

Table of contents

  1. Environment variables
  2. How to dev
  3. How to publish
  4. Commands

Environment variables and secrets

GitHub Secrets

Set BOT_TOKEN and BOT_URL secrets. BOT_URL being the netlify live url.

Netlify env variables

Set BOT_TOKEN, MONGODB_USERNAME and MONGODB_PASSWORD.

How to dev

Install dependencies

yarn install

Start watching src files

yarn watch

Start live dev server

yarn dev

This starts a public live session of Netlify Dev.

Set bot webhook

https://api.telegram.org/bot{your-bot-api-token}/setWebhook?url={netlify-dev-url}/bot

Go to above url in your browser and replace the token and the url. This tells the bot to call your dev instance instead of the live one.

Adding own modules

src/modules/example.ts

import { TelegrafContext } from "telegraf/typings/context";

export default async(ctx: TelegrafContext) => {
  await ctx.replyWithMarkdown(`Example reply from bot.`);
}

src/bot.ts

import exampleModule from './modules/example';

bot.command('example', (ctx) => exampleModule(ctx))

How to publish

git push to this repo starts the build process on Netlify and the GitHub action takes care of setting the bot's webhook url


Current commands

pukkiparty - send sticker from Pukkipack
tilaafp - subscribe for daily fingerpori
perufptilaus - unsubscribe from daily fingerpori
help - ask for help
lozzi - use optional [h, yh] 
maija - use optional [h, yh]
ylisto - use optional [h, yh]
belvedere - use optional [h, yh]
syke - use optional [h, yh]
piato - use optional [h, yh]
novelli - use optional [h, yh]
tilia - use optional [h,yh]
uno - use optional [h, yh]
rentukka - use optional [h, yh]
siltavouti - use optional [h, yh]
aimo - use optional [h, yh]
fiilu - use optional [h, yh]
ilokivi - use optional [h, yh]
Useful when updating commands with BotFather