@beavernsticks/moleculer-telegram-bot
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

Moleculer logo


Telegram bot support for Moleculer microservices framework based on GrammY. NPM version


Install

$ npm install @beavernsticks/moleculer-telegram-bot --save

Usage

Add TelegramBotMixin to your service

import { TelegramBotMixin } from '@beavernsticks/moleculer-telegram-bot'

broker.createService({
  name: 'greeter',
  mixins: [TelegramBotMixin],
  settings: {
    telegram: {
      token: '<BOT TOKEN>',
    },
  },
  actions: {
    welcome: {
      handler(ctx) {
        return this.sendMessage(ctx, 'Hello!', { tgId: 12345 })
      },
    },
  },
})

Configurations

Setting fields

Property Type Default Description
token string required Bot token from @BotFather.

License

The project is available under the MIT license.

Contact

Copyright (c) 2023 Beaver'n'Sticks

Package Sidebar

Install

npm i @beavernsticks/moleculer-telegram-bot

Weekly Downloads

9

Version

0.0.8

License

MIT

Unpacked Size

5.71 kB

Total Files

5

Last publish

Collaborators

  • flanker72