Common

Namespace

Common

Description:
  • Common Interface

Source:

Namespaces

Discord
Telegram

Methods

(async, static) CommandHandler(interaction)

Description:
  • Handles command call

Source:
Parameters:
Name Type Description
interaction Common.DiscordInteraction | Common.TelegramInteraction

Command interaction

Type Definitions

CommandArg

Source:
Properties:
Name Type Description
name string

Argument name

type 'string'

Argument type (currently only string)

description string

Argument description

optional boolean

true if argument is not necessary

Type:
  • object

CommandDefinition

Description:
  • Common command definition

Source:
Properties:
Name Type Description
command_name string

Command name

args Array.<Common.CommandArg>

List of arguments acceptable by command

limit number

Argument limit Common.Telegram.commonizeContext

is_inline boolean

true if command should be available as an inline command

description string

Command description

Common command definition

Type:
  • object

DiscordInteraction

Source:
Properties:
Name Type Attributes Description
platform 'discord'

Interaction source platform

command_name string <nullable>

Command name

text string

Command input as one line

args Array.<string> <nullable>

Array of command args

from object

Sender info

Properties
Name Type Attributes Description
id string <nullable>

Sender id

username string <nullable>

Sender username

name string <nullable>

Sender name

space object

Info about the entity where command was triggered

Properties
Name Type Attributes Description
type 'guild' | 'private'

Type of an entity

id string <nullable>

Entity id

title string <nullable>

Server name if entity is guild

username string <nullable>

Sender username if entity is private

name string <nullable>

Sender name if entity is private

id string

Interaction id

data string <nullable>

Callback query data

Type:
  • object

TelegramInteraction

Source:
Properties:
Name Type Attributes Description
platform 'telegram'

Interaction source platform

command_name string <nullable>

Command name

text string

Command input as one line

args Array.<string> <nullable>

Array of command args

from object

Sender info

Properties
Name Type Attributes Description
id number

Sender id

username string <nullable>

Sender username

name string <nullable>

Sender name

space object

Info about the entity where command was triggered

Properties
Name Type Attributes Description
type 'private' | 'group' | 'supergroup' | 'channel'

Entity type

id number | string

Entity id

title string <nullable>

Chat title if entity type is not private

username string <nullable>

Sender username if entity is private

name string <nullable>

Sender name if entity is private

id string

Interaction id

data string <nullable>

Callback query data

Type:
  • object