Telegram-API Library Written in TypeScript

Overview

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 - [email protected] - 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.
You might also like...

Telegram bot for Youtube-dl

Telegram bot for Youtube-dl

English youtube-dl download telegram bot ydls와 함께 사용할 수 있는 봇으로, Docker가 설치되는 곳이면 어디든 설치가 가능하다 (ex: 리눅스 서버, 시놀로지 나스) 기존에 ydls 이미지를 그대로 사용하였지만, 채널 이름과,

Oct 19, 2022

🔔 Get an alert on Telegram when there are Raspberry in stock ready to buy

🔔 Get an alert on Telegram when there are Raspberry in stock ready to buy

Raspberry instock check bot Get an alert on Telegram when there are Raspberry in stock ready to buy. This bot uses the website https://rpilocator.com/

Dec 16, 2022

Weblookup Telegram bot - The usefully bot like check website, screenshot

Weblookup Telegram bot - The usefully bot like check website, screenshot

Weblookup Telegram bot - The usefully bot like check website, screenshot

May 9, 2022

A telegram bot that sends the current day's foreign exchange rates to its subscribers

Birr Forex Bot A bot that sends the current day's foreign exchange rates to its subscribers. Using the bot Check out the bot here. Running the bot It

Dec 21, 2022

Laporan keuangan, pencatatan pengeluaran dengan Bot Telegram yang terintegrasi dengan Google Spreadsheet

Laporan keuangan, pencatatan pengeluaran dengan Bot Telegram yang terintegrasi dengan Google Spreadsheet

laporan-keuangan-bot Laporan keuangan, pencatatan pengeluaran dengan Bot Telegram yang terintegrasi dengan Google Spreadsheet Mulai Buat Bot telegram

Dec 19, 2022

HTML5 fmp4 live stream (ll-fmp4) player written in TypeScript

umataste HTML5 fmp4 live stream (ll-fmp4) player written in TypeScript Feature Playback for fmp4 stream Extremely low latency of less than 0.1 second

Oct 21, 2022

A bot Similar to the reaction roles discord bot, but free. Written in JavaScript, and uses MongoDB.

Discord Reaction Roles bot About • Features • Installation • Setting Up About An open source reaction roles bot to anyone who needs one in their serve

Dec 22, 2022

An Easy to use and advanced working multiguild Waitingroom Bot written in discord.js v13 without any extra modules.

An Easy to use and advanced working multiguild Waitingroom Bot written in discord.js v13 without any extra modules.

Multiguild-Waitingroom-v13 An Easy to use and advanced working multiguild Waitingroom Bot written in discord.js v13 without any extra modules. It is m

Dec 11, 2022

Skeleton for a discord.js v13 bot written in TS with Slash Command support.

Discord.js v13 Bot Skeleton/Core This repository is a template for creating a Discord bot using Discord.js v13 with Slash Command support. This projec

Nov 2, 2022
Releases(6.0.02)
Owner
MohammadMahdi Afshar
Full Stack Web Developer, FLOSS-Lover.
MohammadMahdi Afshar
A typescript telegram bot with just two works in mind.

Minitsbot aka @Akagiprobot Made in ❤️ with Grammy and deno. A typescript telegram bot with just two works in mind: Autoapproves new join requests. (Ch

Divide Projects 3 Jun 7, 2022
Bot sviluppato in Node.js che permette la prenotazione e il successivo invio dello screenshot di quest'ultima tramite un bot di telegram.

Unimore-Bot Bot sviluppato in Node.js che permette la prenotazione e il successivo invio dello screenshot di quest'ultima tramite un bot di telegram I

Lorenzo Codeluppi 8 Jun 9, 2022
A Discord <-> Telegram bridge rewrote from scratch, in Node.js

Discord-Telegram-bridge A small and fast telegram to discord chat bridge, written in Node.js Setup: If you want to run it on heroku, you can just clic

Sebastiano Barezzi 6 Apr 14, 2022
Cem Karaca - Telegram Bot

Cem Karaca Telegram botu | Bot Cem Karaca şarkılarını tanıtmak için yapıldı. Bot: https://t.me/cem_karaca_bot Botun kullanımı: /start - Botu başlat /h

Lucifer25x 1 Jan 10, 2022
Um simples bot para o Telegram que baixa vídeos e áudios do TikTok & outras funcionalidades

Kelle Estella (Telegram) Um simples bot para o Telegram que baixa vídeos e áudios do TikTok & outras funcionalidades. Clique aqui para utilizá-lo. Com

Luis Gabriel Araújo 3 Apr 20, 2022
exercícios feitos com o pessoal do telegram

Turma - Pré-Trybe Desafios para treinos Exercícios feitos para pessoas que estão aprendendo agora!! Entre em nosso grupo no Telegram e no Discord Níve

Lucival dos Santos França Filho 3 Jun 13, 2022
Telegram & Discord chat bot for Airline Manager 4

AM4 Bot AM4 Bot was a Discord & Telegram chat bot used in 63 servers and across several Telegram chats between 2020-2022 for the game Airline Manager

Fin 5 Jun 5, 2022
Telegram bot with a graphical interface that enables you to schedule messages and generate automatic replies 🤖

Telegram bot with a graphical interface that enables you to schedule messages and generate automatic replies ??

rn0x 5 Dec 6, 2022
Telegram voice recognition bot

Node.js bot for telegram messenger based on Microsoft Azure Speech Service and Node.js Telegram Bot API

Dmitry 4 Mar 9, 2022
a Node.js boilerplate to start creating your telegram bot without too much configuration at the beginning

node-telegram-bot-starter-pack How to use clone the repo run npm install run cp .env.example .env and replace the variables with your data define your

Mohammad MohammadAlian 7 Sep 7, 2022