Telegram

Warning

We are currently working to give Telegram support to latest version of T3SF. Please use Version 1.1 if you want to run an exercise on this platform.

We are expaning our framework’s support to this new platform as clients requested us. Not all the functions/features from the main platforms (Discord/Slack) could be migrated due to Telegram limitations.

Functions

SendMessage(title, description, ctx=None, player=None, image=None)

Message sending controller.

title

The title of the message.

Type:

str

Required:

True

description

The description/main text of the message.

Type:

str

Required:

True

ctx
Type:

ctx

Required:

False

player

The player’s inbox id to send the message.

type:

int

required:

False

image

Attach an image to the message.

type:

str

required:

False

EditMessage(title, description, response)

Message editing controller.

title

The title of the message.

Type:

str

Required:

True

description

The description/main text of the message.

Type:

str

Required:

True

response

The previous response message’s object containing the edit message function.

Type:

object

Required:

True

InboxesAuto(message=None)

Fetches half manual, half automatically the inboxes, based in a command (!add) from the game master in the inbox channel, notifies the Game masters about differents parts of this process.

message

The message from the game master, to add an inbox to the list.

type:

str

required:

False

InjectHandler(self)

Gives the format to the inject and sends it to the correct player’s inbox.

Bot

Installation

  1. Git clone this repository.

  2. Go inside the Telegram version folder with cd T3SF/Telegram/

  3. Install requirements.

    pip3 install -r requirements.txt

    (Optional) Create a virtual environment python3 -m venv venv

  4. Create/Get the Bot’s token from @BotFather.

  5. Add the token to en .env file.

  6. Run the bot with python3 bot.py

  7. Add the Bot to every channel, such as Inboxes channel, GM-Chat, etc.

  8. Done!