6.0.11 • Published 2 years ago

@telelib/telelib v6.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

TeleLib

a node js Telegram Wrapper written in TypeScript.

installation

yarn add @telelib/telelib

or

npm i --save @telelib/telelib

how to use

create a .js or a .ts file install the package using npm or yarn

import the package:

import { Bot } from '@telelib/telelib'

create an instance:

const TelegramBot = new Bot({
 telegram: {
  token: '[TOKEN]',
 },
 debug: true
})

since it's typescript, import Types as well

import { types } from '@telelib/telelib'
  • replace [TOKEN] with your telegram bot token

create a listener on 'Message' Type:

TelegramBot.client.on(
 'message',
 (msg: types.Message) => {
  if (msg.text) {
   return msg.reply(`your message was:\n${msg.text}`)
  }
  msg.reply('i only understand text messages')
 }
)

then start the loop to fetch updates from telegram.

TelegramBot.start()
  • for more examples visit examples
  • for better and more detailed documentation visit docs

more info

issues / bugs / suggestions ?

there's no template for now, just open an issue or fix it and do a Pull request, your name will be here as a contributor. :)

contributors

Mohammad Mahdi Afshar - me@mamad.dev - Telegram - Maintainer

todo list

  • Write Full Documentation
  • add Helper methods
  • Add More examples
  • Write Interfaces for all Message types, classes, methods.
  • Add Support for Webhooks
  • Implement TelegramPassport related methods
  • Add MTProto and TDLib Wrapper.
  • Clean up and optimize the code.
6.0.11

2 years ago

6.0.10

2 years ago

6.0.9

2 years ago

6.0.8

2 years ago

6.0.7

2 years ago

6.0.6

2 years ago

6.0.5

2 years ago

6.0.4

2 years ago

6.0.3

2 years ago

6.0.2

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago