Skip to content

IHZAQ/telegram-command-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Command Handler for Telegram Bot (node-telegram-bot-api)

INFO

How do you make a new commands?

  1. Go to Terminal/Shell and run npm install to install all important dependencies
  2. Make a new .js file in commands folder.
  3. Populate the file with the code represent here:
module.exports = {
   name: "ping",
   execute: async (bot, msg, chat) =>{
   	bot.sendMessage(chat, "Pong!")
   }
}

the chat variable represents chat id, so bot is gonna send a message "Pong!" to that chat

If you want to make bot replied. do /ping. and it will replied with Pong!

I also advised you to visit the Github repository of node-telegram-bot-api package so you can get more information on how to send a picture, do advance stuff, and etc

About

Command Handler for Telegram

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published