An open API service indexing awesome lists of open source software.

https://github.com/sajad-ahmadnzhad/telegrammusicbot

Receive all kinds of music from the music bot in Telegram
https://github.com/sajad-ahmadnzhad/telegrammusicbot

bot botmusic node-telegram-bot-api telgram-bot

Last synced: 2 months ago
JSON representation

Receive all kinds of music from the music bot in Telegram

Awesome Lists containing this project

README

        

Telegram Music Bot





An advanced Telegram music bot with a variety of singers developed with the node-telegram-bot-api library

⚠️ Music bot is not yet deployed on the server, it will be deployed soon



What capabilities does this robot have?

- User's favorite music list
- Adding a reader to the list of favorites by the user
- Invite friends to the bot
- Add comments to music and see other people's comments
- Robot music management panel by the manager
- Send music to friends
- Get biographies of singers
- Music request if the desired music is not found
- Online music search
- Etc ....


What libraries are used in this robot?

- node-telegram-bot-api
- mongoose
- nodemon


Databases used in this robot:

- mongodb

How to install node-telegram-bot-api library

```
npm i -g node-telegram-bot-api
```

How node-telegram-bot-api works

```js
let telegrambot = require("node-telegram-bot-api");
// You need to get the bot token from botfather in Telegram
let token = "Your bot token";

let bot = new telegrambot(token, { poling: true });

bot.onText(/\/start/ , (msg) => {
let chatId = msg.chat.id
bot.sendMessage(chatId , "welcome to bot")
})

bot.on("message", (msg) => {
let chatId = msg.chat.id;

let replyMarkup = {
inline_keyboard: [
[
{ text: "click To button 1", callback_data: "click 1" },
{ text: "click To button 2", callback_data: "click 2" },
],
],
};

if (msg.text == "list") {
bot.sendMessage(chatId,`Hello ${msg.from.first_name} welcome to bot`, {reply_markup: replyMarkup});
}

});

bot.on("callback_query", (msg) => {
let data = msg.data;
let chatId = msg.from.id;
if (data == "click 1") {
bot.sendMessage(chatId, "Option 1 was clicked");
} else if (data == "click 2") {
bot.sendMessage(chatId, "Option 2 was clicked");
}
});
```

output