Skip to content

elvensmile/greeting_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Greeting Bot Hosted on Firebase

Simple bot for greeting new people in your telegram group chat.

Table of Contents

First Steps:

Important steps before using this project:

  1. Create your Bot
    Search in telegram @BotFather or open this link
    Write the command “/newBot “
    Follow all the steps Write down 2 things :

    • bot name (finished in ‘bot’): In example firebaseBot
    • Secret Token (don’t miss it): in example LONG_STRING_TOKEN
  2. Create your Firebase project
    Go to your firebase console https://console.firebase.google.com
    Add a new project
    Write down the id of the project: in example firebase-bot-xxYYx

    Upgrade your plan to Blaze (pay-as-you-go, No-cost up to 2M/month invocations: it's about 70000 messages in day for your bot to handle )

Getting Started:

Clone the project. Install globally firebase-tools: npm install -g firebase-tools Login into firebase: firebase login Init firebase in the same folder: firebase init functions Choose:

  • existing project
  • overwrite default
  • overwrite index.ts - NO

Check .firebaserc, make sure that "default" field contains the id of your firebase project.

"default": /*add your project id firebaseBot-xxYYx */

Set environment variables with following commands:

You bot token from 1.

firebase functions:config:set telegram.token="<LONG_STRING_TOKEN>"

Url of your project, usually region+firebase project id:

firebase functions:config:set telegram.url="https://us-central1-<YOURFIREBASEPROJECTID>.cloudfunctions.net/bot"

Greetings

Feel free to modify array "greetings" in index.ts to add your own funny greetings for users.

Deployment

Use npm deploy

After the deployment you can test your bot with "/testme" command.

About

Simple greeting bot for small groups in telegram.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published