Skip to content

flynncao/grammY-bot-template

Repository files navigation

grammY-bot-template

A boilerplate template that applies the GrammY framework to help you get started with the Telegram bot.

Features

  • Structured & modularized code practice
  • TypeScript & ESLint
  • Mongodb(Mongoose&Typegoose) support

Startup

Rename .env.example to .env, replace values of BOT_TOKEN and USER_CHAT_ID to yours.

How to create a Telegram chatbot yourself?

Add Bot Father to your contact, use /newbot command to create your own bot. You will get your HTTP api token as BOT_TOKEN eventually.

20240101153019

How to get my own chatid?

  • Fastest way: Add Get My ID to your contact, use /start command and you will get your current chatid as your USER_CHAT_ID.

  • Conventional way: Visit Telegram Web, open Saved Messages chat window, the number behind web.telegram.org/a/# is your user chatid, sometimes it is a negative figure. (You can also appy this approach to get your group channel chatid, etc.)

Commands Preset

  • /start Welcome text
  • /help Show help text
  • /settings Open settings
  • /wallpaper Get a random wallpaper from Unsplash(need to fill in access token in .env file under root directory)

To enable the /wallpaper command, you need to apply a unsplah api key and insert it into .env

  • /about Show information about the bot

Thanks to

https://github.com/grammyjs/grammY https://github.com/ShoroukAziz/notion-potion

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •