Visit: Guide on .env encryption (#sops)
Quick Links:
- Styled text with message entities: Click here
- Can i get token for my own telegram account as well so i can send messages via telegram api call? ChatGPT
- tldr; Use gramjs
❤️ Official Telegram Bot API: Click here
- Javascript:
telegraf:- ❤️ Used in files:
server1.jsandserver2-chihiro-ai-bot.js. - Github: Click here 8.9k*
- Docs: Click here
- ❤️ Used in files:
gramjs- (NodeJS/Browser MTProto API Telegram client library)- Github: Click here 1.6k*
- A Telegram client written in JavaScript for Node.js and browsers, with its core being based on Telethon.
- TODO_TRY
grammY- The Telegram Bot Framework- Github: Click here 3.4k*
- Used by openclaw: Openclaw (Deepwiki)
- Python:
telethon: Pure Python 3 MTProto API Telegram client library, for bots too!- Github: Click here 6.4K*
- Docs: grammy.dev
- Concurrency With grammY runner: Click here
- runner Github Repo: Click here
Source: ChatGPT
NOTE: Using telgramf in general way deletes your webhook url, please check file server1.js for more info.
- ❤️ You can create webhook via -
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/setWebhook?url=https://yourdomain.com/webhook- ✅ Now, you can handle the post requests to handle incoming messages to the bot.
- ❤️ You can delete the webhook via -
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/deleteWebhook
✅ Example with webhook url:
export const telegramWebhookController = (req, res) => {
console.log("Received message:", req.body);
// Output:
// {
// update_id: 308413898,
// message: {
// message_id: 14295,
// from: {
// id: 711263195, // * `userChatId`
// is_bot: false,
// first_name: 'Sahil',
// last_name: 'Rajput',
// username: 'SahilRajput03', // * `username`
// language_code: 'en'
// },
// chat: {
// id: 711263195,
// first_name: 'Sahil',
// last_name: 'Rajput',
// username: 'SahilRajput03',
// type: 'private'
// },
// date: 1758737582,
// text: '❤️❤️❤️😍😍🙂🙂' // * `message`
// }
// }
return void res.sendStatus(200);
};
app.post("/api/v1/telegram/webhook", telegramWebhookController);- Official Telegram audio/video call api docs (Awesome Docs): Click here [NOT TESTED]
- ❤️ Telegram radio experiment Using
lemonjamsbot(My Latest Experiment): Click here, lemonjamsbot - Using
magnalunaandphp-libtgvoip
# Installation
sudo apt-get install libopus-dev libssl-dev build-essential php7.4-dev php7.4
git clone https://github.com/copernicamarketingsoftware/PHP-CPP && cd PHP-CPP && make -j$(nproc) && sudo make install && cd ..
git clone --recursive https://github.com/danog/php-libtgvoip && cd php-libtgvoip && make && sudo make install
# Installs the XML extension for PHP 7.4.
sudo apt-get install php7.4-xml
# Installs the Multibyte String (mbstring) extension for PHP 7.4.
sudo apt-get install php7.4-mbstring
# Download magnaluna script
wget https://github.com/danog/magnaluna/raw/master/magna.php
# Run magnaluna script
php magna.php
# FYI: When asked for number use 918360****** and use automated process to login instead of using the user api and api_tokens.Thanks.