Added a Telegram Bridge chat bot.

This commit is contained in:
Milutinke 2022-10-24 15:35:24 +02:00
parent 1a739eeab5
commit 1272ffda0b
6 changed files with 351 additions and 29 deletions

View file

@ -624,7 +624,7 @@ bot.DiscordBridge.channel_not_found=The provided channel with an id '{0}' has no
bot.DiscordBridge.unknown_error=An unknown error has occured!
bot.DiscordBridge.canceled_sending=Sending message to Discord was canceled due an error occuring. For more info enable Debug.
bot.DiscordBridge.desc=This command allows you to specify in the which direction the messages will be relayed via the Discord Bridge chat bot.
bot.DiscordBridge.invalid_direction=Invalid direction provided! Avaliable directions: both|b, minecraft|mc, discord|dsc. Example: "dscbridge direction mc"
bot.DiscordBridge.invalid_direction=Invalid direction provided! Available directions: both|b, minecraft|mc, discord|dsc. Example: "dscbridge direction mc"
bot.DiscordBridge.direction=Direction of the Discord Brdige has been switched to '{0}'!
bot.DiscordBridge.direction.both=Both
bot.DiscordBridge.direction.minecraft=Minecraft
@ -751,6 +751,21 @@ bot.scriptScheduler.running_inverval=Interval / Running action: {0}
bot.scriptScheduler.running_login=Login / Running action: {0}
bot.scriptScheduler.task=triggeronfirstlogin: {0}\n triggeronlogin: {1}\n triggerontime: {2}\n triggeroninterval: {3}\n timevalue: {4}\n timeinterval: {5}\n action: {6}
# TelegramBridge
botname.TelegramBridge=TelegramBridge
bot.TelegramBridge.command_executed=The command was executed with the result
bot.TelegramBridge.connected=Succesfully connected with MCC!
bot.TelegramBridge.missing_token=Please provide a valid bot token!
bot.TelegramBridge.missing_channel_id=[WARNING] You have not provided a Channel ID, you will ONLY get replies to commands sent from Telegram!
bot.TelegramBridge.unknown_error=An unknown error has occured!
bot.TelegramBridge.canceled_sending=Sending message to Telegram was canceled due an error occuring. For more info enable Debug.
bot.TelegramBridge.desc=This command allows you to specify in the which direction the messages will be relayed via the Telegram Bridge chat bot.
bot.TelegramBridge.invalid_direction=Invalid direction provided! Available directions: both|b, minecraft|mc, telegram|tg|t. Example: "tgbridge direction mc"
bot.TelegramBridge.direction=Direction of the Telegram Brdige has been switched to '{0}'!
bot.TelegramBridge.direction.both=Both
bot.TelegramBridge.direction.minecraft=Minecraft
bot.TelegramBridge.direction.Telegram=Telegram
# TestBot
botname.TestBot=TestBot
bot.testBot.told=Bot: {0} told me : {1}
@ -1003,3 +1018,10 @@ config.ChatBot.ReplayCapture.Backup_Interval=How long should replay file be auto
# ChatBot.ScriptScheduler
config.ChatBot.ScriptScheduler=Schedule commands and scripts to launch on various events such as server join, date/time or time interval\n# See https://mccteam.github.io/guide/chat-bots.html#script-scheduler for more info
# ChatBot.TelegramBridge
config.ChatBot.TelegramBridge=This bot allows you to send and receive messages and commands via a Telegram Bot DM or to receive messages in a Telegram channel.\n# /!\ NOTE: You can't send messages and commands from a group channel, you can only send them in the bot DM, but you can get the messages from the client in a group channel.\n#-----------------------------------------------------------\n# Setup:\n# First you need to create a Telegram bot and obtain an API key, to do so, go to Telegram and find @botfather\n# Click on "Start" button and read the bot reply, then type "/newbot", the Botfather will guide you through the bot creation.\n# Once you create the bot, copy the API key that you have gotten, and put it into the "Token" field of "ChatBot.TelegramBridge" section (this section).\n# /!\ Do not share this token with anyone else as it will give them the control over your bot. Save it securely.\n# Set the "Enabled" field to true (in this section), then enable "DebugMessages" by setting it to true, in the "Logging" section and save the file.\n# Then launch the client and go to Telegram, find your newly created bot by searching for it with its username, and open a DM with it.\n# Click on "Start" button and type and send any message to the bot, then in the client console you should see something like: "[MCC] [TelegramBridge] Received a 'e' message in chat 2127848600."\n# Copy the chat number (eg. 2127848600) and paste it in the "ChannelId" field (in this section), disable "DebugMessages" if you want and save the file.\n# Now you can use the bot using it's DM.\n#-----------------------------------------------------------\n# NOTE: If you want to recieve messages to a group channel instead, make the channel temporarely public, invite the bot to it and make it an administrator, then set the channel to private if you want.\n# Then set the "ChannelId" field to the @ of your channel (you must include the @ in the settings, eg. "@mysupersecretchannel"), this is the username you can see in the invite link of the channel.\n# /!\ Only include the username with @ prefix, do not include the rest of the link. Example if you have "https://t.me/mysupersecretchannel", the "ChannelId" will be "@mysupersecretchannel".\n# /!\ Note that you will not be able to send messages to the client from a group channel!\n#-----------------------------------------------------------\n# How to use the bot:\n# To execute an MCC command, prefix it with a dot ".", example: ".move 143 64 735" .\n# To send a message, simply type it out and hit enter.
config.ChatBot.TelegramBridge.Token=Your Telegram Bot token.
config.ChatBot.TelegramBridge.ChannelId=The ID of a channel where you want to interact with the MCC using the bot.
config.ChatBot.TelegramBridge.MessageSendTimeout=How long to wait (in seconds) if a message can not be sent to Telegram before canceling the task (minimum 1 second).
config.ChatBot.TelegramBridge.Formats=Message formats\n# Words wrapped with { and } are going to be replaced during the code execution, do not change them!\n# For example. {message} is going to be replace with an actual message, {username} will be replaced with an username, {timestamp} with the current time.\n# For Telegram message formatting, check the following: https://sendpulse.com/blog/telegram-text-formatting