Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Bot

Sample bot using the AlertManager and UserOnly modules.

Index

References

IBotContext

Re-exports IBotContext

bot

Re-exports bot

Variables

Const externalUrl

externalUrl: string = process.env.EXTERNAL_URL

Const greetingCommand

greetingCommand: (Anonymous function) = textReplyMiddleware("Hey there")

Const helpCommand

helpCommand: (Anonymous function) = textReplyMiddleware("Send me a sticker")

Const port

port: number = parseInt(process.env.PORT || "8443", 10)

Const telegramAdmins

telegramAdmins: string = process.env.TELEGRAM_ADMINS

Const telegramToken

telegramToken: string = process.env.TELEGRAM_TOKEN

Functions

Const bot

Const startCommand

  • adds the user to the alertmanager context to receive alert messages

    Parameters

    Returns Promise<void>

    callback chain result

Const stickerCommand

Const textReplyMiddleware

  • textReplyMiddleware(text: string, extra?: ExtraReplyMessage): (Anonymous function)
  • replies user with plain text

    Parameters

    • text: string

      message context

    • Optional extra: ExtraReplyMessage

      optional message settings

    Returns (Anonymous function)

    callback chain result

Generated using TypeDoc