TelegramInteraction

TelegramInteraction

One time use interaction between app and telegram

Constructor

new TelegramInteraction(client, command_nameopt, contextopt)

Description:
  • One time use interaction between app and telegram

Source:
Properties:
Name Type Attributes Description
this.client TelegramClient
this.command_name String <nullable>
this.context Context <nullable>
Parameters:
Name Type Attributes Description
client TelegramClient
command_name String <optional>
context Context <optional>

Members

api

Source:

registered_commands

Source:

Methods

(async) _answerQuery(results_array, overridesnullable) → {undefined|Promise}

Description:
  • Asnweres inline query accroding to passed results

Source:
Parameters:
Name Type Attributes Description
results_array Array.<Object>
overrides Object <nullable>
Returns:
Type
undefined | Promise

_generateInlineMedia(media, overridesnullable) → {Object}

Description:
  • Generate inline query result from media

Source:
Parameters:
Name Type Attributes Description
media Object
overrides Object <nullable>
Returns:
Type
Object

_generateInlineText(text, overrides) → {Object}

Description:
  • Generate inline query result from text ("article")

Source:
Parameters:
Name Type Description
text String
overrides Object
Returns:
Type
Object

_getReplyMethod(media_type)

Description:
  • Get reply method associated with content type

Source:
Parameters:
Name Type Description
media_type String
Returns:

_parseMessageMedia(message)

Source:
Parameters:
Name Type Description
message
Returns:

(async) _reply(text) → {Promise.<Message>}

Description:
  • Reply to message with text

Source:
Parameters:
Name Type Description
text String

text to send

Returns:
Type
Promise.<Message>

(async) _replyWithArticle(text, overrides, parse_mode)

Description:
  • Reply with link to Telegra.ph article

Source:
Parameters:
Name Type Description
text string
overrides
parse_mode 'html' | 'markdown'

(async) _replyWithMedia(message) → {Promise.<Message>}

Description:
  • Reply to message with media file

Source:
Parameters:
Name Type Description
message Object

may contain text and an id of one of [animation, audio, document, video, video_note, voice, sticker]

Returns:
Type
Promise.<Message>

(async) _replyWithMediaGroup(message, overrides) → {Promise.<Message>}

Description:
  • Reply to message with media group

Source:
Parameters:
Name Type Description
message Object

contains media group

overrides Object | null
Returns:
Type
Promise.<Message>

(async) answer() → {undefined|Promise}

Description:
  • High level command for answering inline query Returns nothing or the promise for answerInlineQuery

Source:
Returns:
Type
undefined | Promise

getWithEntities(message)

Source:
Parameters:
Name Type Description
message

reply()

Description:
  • High level function for replying to Telegram-specific commands Returns undefined or promise for reply request

Source: