Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 1.13 KB

File metadata and controls

26 lines (20 loc) · 1.13 KB

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