airgram / Airgram
Licence: gpl-3.0
Strict typed library to create Telegram apps with Typescript/JavaScript (based on TDLib 1.6)
Stars: ✭ 296
Programming Languages
javascript
184084 projects - #8 most used programming language
typescript
32286 projects
Labels
Projects that are alternatives of or similar to Airgram
checkmk-telegram-notify
Get alerted by Check_MK via Telegram bash script
Stars: ✭ 28 (-90.54%)
Mutual labels: telegram
remoteTelegramShell
control your Linux OS computer through Telegram
Stars: ✭ 73 (-75.34%)
Mutual labels: telegram
rollem-telegram-bot
🎲 An RPG dice rolling bot for Telegram.
Stars: ✭ 26 (-91.22%)
Mutual labels: telegram
TeleShadow2
TeleShadow - Telegram Desktop Session Stealer (Windows)
Stars: ✭ 88 (-70.27%)
Mutual labels: telegram
nebula8
Open source bot to administer a telegram group with different functionalities and blacklist
Stars: ✭ 21 (-92.91%)
Mutual labels: telegram
raspberry pi home security system
Home monitoring system with a Raspberry Pi and sending notifications with a Telegram bot
Stars: ✭ 14 (-95.27%)
Mutual labels: telegram
Telegram Bot Swift
Telegram Bot SDK for Swift (unofficial)
Stars: ✭ 275 (-7.09%)
Mutual labels: telegram
shellbot
API em Shell Script para desenvolvimento de Bots na plataforma Telegram.
Stars: ✭ 87 (-70.61%)
Mutual labels: telegram
Infomate.club
RSS feed collections with article summarization
Stars: ✭ 255 (-13.85%)
Mutual labels: telegram
ForwardTagRemoverBot
A Telegram Bot To Hide Forward Source
Stars: ✭ 54 (-81.76%)
Mutual labels: telegram
gofilesbot
Filter bot for file serving groups. The bot is performing its function in a different way! Read for more...
Stars: ✭ 28 (-90.54%)
Mutual labels: telegram
Telegram.bot.examples
Examples for the Telegram.Bot C# Library
Stars: ✭ 290 (-2.03%)
Mutual labels: telegram
Telegram List
List of telegram groups, channels & bots // Список интересных групп, каналов и ботов телеграма // Список чатов для программистов
Stars: ✭ 3,362 (+1035.81%)
Mutual labels: telegram
Telegram Bot Api
Golang bindings for the Telegram Bot API
Stars: ✭ 3,275 (+1006.42%)
Mutual labels: telegram
Airgram
This is a wrapper for Telegram Database library written in TypeScript.
- Code style. TDLib follows a different coding convention than best practices in TypeScript or JavaScript. Airgram fixes it.
- Methods. Each API method has convenient wrapper with description and JSDoc documentation.
- Type checking. Airgram is a true TypeScript library. Everything has strict typings, so take full advantage of type checking and code completion.
- Flexibility. Airgram relies on middleware. This gives a high degree of freedom. You can modify requests, save responses, perform any actions in the data flow.
- Data models. You can extend standard TDLib objects and add some computed properties or whatever you want.
- Use everywhere. Airgram is an environment agnostic library. It will work in the browser as well as in Node.js. You can write Telegram client or use it for a Telegram bot backend.
Installation
Node.js
- Build TDLib library according the instruction.
- Install node-gyp
- Install Airgram:
npm install airgram
Web
npm install @airgram/web
Check out webpack config example.
Getting started
import { Airgram, Auth, prompt, toObject } from 'airgram'
const airgram = new Airgram({
apiId: process.env.APP_ID,
apiHash: process.env.APP_HASH
})
airgram.use(new Auth({
code: () => prompt(`Please enter the secret code:\n`),
phoneNumber: () => prompt(`Please enter your phone number:\n`)
}))
void (async () => {
const me = toObject(await airgram.api.getMe())
console.log(`[me]`, me)
})
// Getting all updates
airgram.use((ctx, next) => {
if ('update' in ctx) {
console.log(`[all updates][${ctx._}]`, JSON.stringify(ctx.update))
}
return next()
})
// Getting new messages
airgram.on('updateNewMessage', async ({ update }, next) => {
const { message } = update
console.log('[new message]', message)
return next()
})
Documentation
Guides and API-reference are available here.
Old version
If you are interested in v1.*
, follow to corresponding branch.
License
The source code is licensed under GPL v3. License is available here.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].