1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Addon Skelegram - The Skript Telegram Addon! 1.1-ALPHA

Create a Telegram Bots directly in Skript!

  1. DereWah
    Supported Minecraft Versions:
    • 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19
    Hello everyone, I'm glad to announce
    a skript addon for creating Telegram Bots entirely in Skript.

    A telegram message with buttons, created and sent entirely via Skript.​
    Code (Text):
    1. Options:
    2. p: &7[&bTG&7]
    3.     username: SkriptItaly_bot #the username of the bot.
    4.     token: TOKEN-HERE #the token of the bot
    8. on load:
    9.     send message "{@p} &9Authorizing telegram bot {@username}..." to console
    10.     telegram login to bot "{@username}" with token "{@token}"
    11.     send message "{@p} &9Completed." to console
    13. on telegram message:
    14.     if "%event-telegram bot%" is "{@username}":
    15.         set {_mess} to a new telegram message with text "Welcome, @%sender of event-telegram message% to Skelegram!%nl%%nl%This Telegram bot has been entirely coded in ‍ Skript!"
    16.         set {_link} to a new inline button with text " Link " with url "https://github.com/DereWah/Skelegram"
    17.         set {_data} to a new inline button with text " About Us " with callback data "about_us"
    18.         set {_kb} to a new inline keyboard with buttons {_link} and {_data}
    19.         set inline keyboard of {_mess} to {_kb}
    20.         send telegram message {_mess} to sender of event-telegram message

    TelegramLink is basically a Skript that gives you functions for linking telegram users to minecraft users.

    It is an helper skript, it's just for giving devs a simple and universal way of tracking users. You can choose to create your own method of tracking users.

    How does this work?
    Skelegram allows you to create a bot and interact with Telegram via its Bot API. Here are some possible application ideas (not created yet):

    - Telegram Console - Run any command sent by a trusted user on telegram on the minecraft console.
    - View Minecraft Chat on Telegram - Make the bot echo any message sent in Minecraft onto a Telegram channel.
    - Get Intruder Alerts - Receive a telegram notification whenever a not trusted player enters your house in a region!
    - 2FA - Ask players/staff to send in chat a code they will receive on telegram (they must have linked an account through a linking system before) to verify themselves.

    These are only a few of the possible implementations! But now let's start playing with the addon.

    How do I create a bot?
    1. Create a bot on telegram.
    On telegram, start
    BotFather and follow the tutorial to create a bot. You will be asked for details about the bot. After setting it up, you will receive a message with a long token in it. Copy it and save it, as you will need it soon. Also save the unique username of the bot.
    2. Create a new skript and authorize the bot.
    Copy the code below to have a template authorization skript.
    Code (Text):
    1. Options:
    3.     p: &7[&bSkelegram&7]
    4.     username: SkriptItaly_bot #the username of the bot.
    5.     token: TOKEN-HERE #the token of the bot
    7. on load:
    8.     send message "{@p} &9Authorizing telegram bot {@username}..." to console
    9.     telegram login to bot "{@username}" with token "{@token}"
    10.     send message "{@p} &9Completed." to console
    2.1 About bot sessions
    Read this before going ahead with the tutorial please.
    A telegram bot can be controlled by only 1 Skript at a time.
    If you have multiple skripts running the same bot, you might end up receiving API errors in the console.
    Bots are controlled by sessions, and in Skelegram, you can have multiple sessions running, but only 1 for each bot.

    Reloading a skript does not stop a session!
    This means that you can quickly edit your bot behaviour without having to send it offline.
    Server reloads or restarts DO stop all the sessions!
    And because stopping a session may take up to 50 seconds, those operations may take a little bit longer. It is how the Telegram API works, and you can't do much about it.

    3. Customize your bot behaviour.
    You can now setup your bot to connect Telegram to Minecraft! Let's see some examples.

    You can listen for incoming messages via the event
    Code (Text):
    1. on telegram message:
    If you have multiple bots running, the event will be fired for any incoming message. You can filter if the message is directed to your bot with
    Code (Text):
    1. on telegram message:
    2.     if "%event-telegram bot%" is "{@username}":
    3.         #the message is for our bot!
    Let's now show the message we just received on Telegram in minecraft! This will allow any player that uses the bot to send a visible message to all the players in game.

    Code (Text):
    1. Options:
    2.     p: &7[&bTG&7]
    3.     username: SkriptItaly_bot #the username of the bot.
    4.     token: TOKEN-HERE #the token of the bot
    6. on load:
    7.     send message "{@p} &9Authorizing telegram bot {@username}..." to console
    8.     telegram login to bot "{@username}" with token "{@token}"
    9.     send message "{@p} &9Completed." to console
    11. on telegram message:
    12.     if "%event-telegram bot%" is "{@username}":
    13.         send "{@p} &9%sender of event-telegram message%&7: %text of event-telegram message%" to all players
    If we want to give some feedback to the user on telegram, we can let them know that their message has been succesfully forwarded to the Minecraft world!

    To do so we can simply use the reply to telegram message effect:
    Code (Text):
    1. reply to telegram message event-telegram message with "Your message has been sent!"

    4. Read the docs!
    You can do a lot more with this addon. You can add buttons, add keyboards to the chat or edit messages! Even though there still are a lot of missing elements of the Telegram BOT Api in the addon, my plan is to implement them all. If you have any specific need from the API (that isn't implemented yet) you can suggest it on the issue tracker on github.

    To learn more about how to use Skelegram at its full power, you can check out the documentation page with some examples HERE.

    In the next few weeks I will create in-depth tutorials on how to create more advanced stuff such as working telegram keyboards and buttons.

    TG: @DereWah
    Discord: DereWah#8414


    1. upload_2023-5-5_20-2-11.png
    2. upload_2023-5-5_21-23-33.png
    3. upload_2023-5-5_21-32-23.png
    4. upload_2023-5-5_21-46-46.png