degreet-telegram
TypeScript icon, indicating that this package has built-in type declarations

2.7.9 • Public • Published

Getting started

import { DegreetTelegram } from 'degreet-telegram'
import { IContext } from 'degreet-telegram/src/types'

const token: string = 'Enter your token here'
const bot: DegreetTelegram = new DegreetTelegram(token)

bot.command('start', async (ctx: IContext): Promise<any> => {
  try {
    await ctx.answer.send('Hello!')
  } catch (e: any) {
    console.error(e)
  }
})

bot.start().then((username: string): void => {
  console.log(`Started on @${username}`)
})

Full example is here: https://github.com/Degreet/link-cloud-bot
Full documentation is here: https://degreetpro.gitbook.io/degreet-telegram

Readme

Keywords

none

Package Sidebar

Install

npm i degreet-telegram

Weekly Downloads

1

Version

2.7.9

License

MIT

Unpacked Size

254 kB

Total Files

74

Last publish

Collaborators

  • degreet