manedev79 / season-crop-farming-bot

A just for fun Telegram bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ci workflow Coverage Status

Season Crop Farming Bot

A just for fun Telegram Bot.

Description

We are using a webhook to implement this bot. Deployment is currently targeted to Heroku.

Features

  1. Help command /help
  2. Say hi and the bot will reply.
  3. Laugh like hahaha and the bot will reply.

This bot can be added to group chats.

Local Development

Prerequisites

  • Linux (tested in Ubuntu)
    • Should be easy to adapt to MacOS, mainly other ngrok binary.
  • curl
  • jq

SSH Tunnel to local webhook

Use ngrok for local webhook testing.

You must set the following env vars for the ngrok related scripts to work:

export NGROK_AUTH_TOKEN=<ngrok-auth-token>
export PORT=8443

NPM start script for local testing

We are using dotenv to load environment variables.
You must to set the following environment variables in .env

BOT_TOKEN=<your-bot-token>
DEBUG='telegraf:*'
URL=https://1234567890.ngrok.io # Auto-set by `ngrok-start.sh`
  • Start ngrok: ./ngrok-start.sh
  • Run npm run start-local

Links

Telegram Bot API Telegraf ngrok

About

A just for fun Telegram bot

License:MIT License


Languages

Language:JavaScript 83.5%Language:Shell 16.5%