modern typescript library for mtproto
documentation
•
api reference
•
telegram chat
[!WARNING] mtcute is currently in alpha stage: the api is not very stable yet, and there may be a lot of bugs feel free to try it out, though, any feedback is appreciated!
releases may not follow semver just yet, so please pin the versions for now
import { TelegramClient } from '@mtcute/node'
import { Dispatcher, filters } from '@mtcute/dispatcher'
const tg = new TelegramClient({
apiId: Number.parseInt(process.env.API_ID),
apiHash: process.env.API_HASH,
storage: 'my-account'
})
const dp = Dispatcher.for(tg)
dp.onNewMessage(filters.chat('private'), async (msg) => {
await msg.replyText('hiiii from mtcute! 🌸')
})
const self = await tg.start({ /* optional params */ })
console.log(`✨ logged in as ${self.displayName}`)
mtcute is a modern, performant and ✨ cute ✨ mtproto library and bot framework, supporting both web and nodejs.
🤖 just starting a (user)bot? use the scaffolding tool:
pnpm create @mtcute/bot
🏭 want to integrate it into your existing nodejs app? use the nodejs package:
pnpm add @mtcute/node
# optional, for faster crypto
pnpm add @mtcute/crypto-node
✨ building something for web? use the web package:
pnpm add @mtcute/web
🚀 using the newfangled runtimes? we've got you covered:
bun add @mtcute/bun
import { TelegramClient } from 'jsr:@mtcute/deno'
learn more: guide
mtcute strives to:
mtcute is NOT and will never be:
git clone https://github.com/mtcute/mtcute
fnm use # or `nvm use`
cd mtcute
pnpm install --frozen-lockfile
# generate code from tl schema
pnpm -C packages/tl run gen-code
some parts were based on or greatly inspired by these projects:
thanks @dotvhs for the logo <3