Telegram
Telegram is an instant messaging app that provides a powerful API that enables applications to send messages through bots. LinuxGSM leverages the Telegram Bot API to dispatch alerts to users, enhancing monitoring and management of gaming servers.
Creating a Telegram Bot
Initiate Bot Creation: Chat with @BotFather on Telegram to start creating your bot. Begin the conversation by clicking "Start".
Register Your Bot: Send
/newbot
to @BotFather and follow the provided instructions to set up your bot. Upon completion, you will receive an API token.Configure LinuxGSM: Fill in the API token into your LinuxGSM config as follows:
Configuring Alerts for a Group
New Group Creation
Select
New Group
within Telegram.Name your group.
Add your bot by searching its
@Username
.
Adding to an Existing Group
Open group info.
Choose to add members.
Search and select your bot by its
@Username
.
Retrieving Your Telegram Chat ID
Activate Your Bot: Interact with your bot in Telegram.
Form the getUpdates URL: Replace the placeholder with your bot's token in
https://api.telegram.org/botXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/getUpdates
.Visit the URL: Use a web browser to access the URL.
Locate the Chat ID: In the JSON response, find the
id
field under thechat
object.Note: The Chat ID for private chats is a positive number and for a group, it's a negative number.
Update LinuxGSM Config: Place your Chat ID in the LinuxGSM config file.
Enabling Telegram Topics (Threads)
Verify that Topics are enabled for your group by checking the group's settings.
If you don't already have a topic created. Create a new Topic by clicking the three dots in the top right corner of the group chat and selecting
New Topic
.Send a message in the Topic you want to use.
Repeat Retrieving Your Telegram Chat ID to retrieve the thread ID by looking for the
message_thread_id
field in themessage
object.Update the
telegramthreadid
field in the LinuxGSM config with the thread ID.
Testing the Configuration
Execute a test alert with ./gameserver test-alert
to verify the setup.
If you receive an alert on Telegram in the right place (group or private chat), the configuration is correct.
Advanced Configuration: Custom cURL String
For specific needs such as bypassing network restrictions, you can specify custom cURL arguments in the configuration.
Last updated