This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cherrytelegram [2024/05/06 00:17] – onslaught | cherrytelegram [2024/05/07 17:43] (current) – onslaught | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | < | + | < |
- | <HTML>< | + | <html>< |
- | {{:: | ||
+ | {{:: | ||
====== Cherry Telegram ====== | ====== Cherry Telegram ====== | ||
Line 45: | Line 45: | ||
=== 2. Create a Telegram Bot === | === 2. Create a Telegram Bot === | ||
- | Follow this link to create your bot [[https:// | + | Follow this link to create your bot [[https:// |
- | Once the bot is created and you have obtained the bot token and while you're still interacting with @botfather, use the < | + | Once the bot is created, and you have obtained the bot token and while you're still interacting with @botfather, use the < |
{{: | {{: | ||
- | === 2. Addon Installation / Initial Settings === | + | === 2. Add-on |
- | - Install both this addon as well as [[https:// | + | - Install both this add-on and [[https:// |
- Enter the game. | - Enter the game. | ||
- | - Open the addon by going into MMOminions | + | - Open the add-on |
{{: | {{: | ||
Line 63: | Line 63: | ||
- Enable " | - Enable " | ||
- Enable "send messages to Telegram" | - Enable "send messages to Telegram" | ||
- | - Not required but I recommend that you enable " | + | - Not required, but I recommend that you enable " |
- | Once those settings are entered in-game, go into Telegram and start a conversation with your bot. You do this by entering the search section and typing in an " | + | Once those settings are entered in-game, go into Telegram and start a conversation with your bot. You do this by entering the search section and typing in an " |
< | < | ||
- | Command | + | Command your bot to start interacting with the game client. If you don't enable " |
- | Once the bot has been connected for a few minutes you should see a list of commands appear in telegram: | + | Once the bot has been connected for a few minutes, you should see a list of commands appear in telegram: |
{{: | {{: | ||
+ | |||
+ | ==== Multi-Boxing ==== | ||
+ | Cherry Telegram supports multi-boxing via multiple telegram bot tokens. Telegram does not allow multiple clients to control a single bot, so you will need a separate Telegram bot token for each instance of Cherry Telegram. Use the profile manager in mmominion to ensure that the bot token is unique for each profile. | ||
==== Mod Setup ==== | ==== Mod Setup ==== | ||
- | Any 3rd party add-on developer can develop an add-on that connects to Cherry Core. That add-on can then send and receive messages and commands from any cherry communication add-on. Cherry Core provides a simple interface for allowing the 3rd party add-on to communicate and at the same time gives the end user full control over what messages they receive and to what platform the messages are routed. | + | Any 3rd party add-on developer can develop an add-on that connects to Cherry Core. That add-on can then send and receive messages and commands from any cherry communication add-on. Cherry Core provides a simple interface for allowing the 3rd party add-on to communicate, and at the same time gives the end user full control over what messages they receive and to what platform the messages are routed. |
Follow the instructions below to build your first mod. | Follow the instructions below to build your first mod. | ||
- | Download {{ :cherry:cherry_modchattest.zip |}} And install it in Mmo Minion | + | Download {{ :cherry:modchattest_-_5.6.24.zip |}} And install it in Mmominion |
- | === CherryConnect | + | === Cherry Connect |
+ | Are you a developer and would like to enable your add-on to send messages to Cherry Telegram? View the API Reference [[cherrycore# | ||
- | The Cherry Connect API is fairly simple and is accessed by the global variable | ||
- | < | + | ==== Troubleshooting ==== |
+ | If you have any questions or need help, please visit the Cherry discord server: | ||
+ | [[https:// | ||
- | Communication with the code is done in two ways: Callback functions | + | ===Debug Level=== |
+ | By default, only severe errors are posted to the console. If you're having issues, | ||
- | Cherry Connect functions are explained below: | ||
- | === CherryConnect.Register === | ||
- | Usage: | ||
- | Registers a mod through the Cherry Connect platform to enable an add-on to send/ | ||
- | < | ||
- | * **author** - // | ||
- | * The name of the author of the mod. | ||
- | * **cmd_func** - // | ||
- | * The function that will be called anytime the user communicates with one of the clients. The function signature must be function(result) | ||
- | * **mod_name** - // | ||
- | * This is the name of the mod and will also become the command that the user will use to communicate with the mod. | ||
- | * **desc** - // | ||
- | * This helps the user understand what the purpose of the mod is and is visible in the mod section of each communication client. | ||
- | **returns** | ||
- | On errors: | ||
- | < | ||
- | { | ||
- | mode = result_modes.error, | ||
- | | ||
- | | ||
- | } | ||
- | </ | ||
- | // See below for possible error codes and messages// | ||
- | On success: | ||
- | < | ||
- | { | ||
- | mode = " | ||
- | | ||
- | } | ||
- | </ | ||
- | //Notes// | ||
- | The mod name cannot conflict with any other mod or command. Mods do not share a 1 to 1 relationship with an add-on, so a single add-on can register multiple mods. | ||
- | **MOD_ID** Will be used in all the other API calls to identify which mod is making the call. The **MOD_ID** must be saved for as long as Cherry Core is not unloaded or until the mod is unregistered. Once the mod is unregistered you must re-register the mod to access a new **MOD_ID** | ||
- | {{: | ||
- | === CherryConnect.Unregister === | ||
- | Usage: | ||
- | < | ||
- | Unregisters the mod from Cherry Connect | ||
- | |||
- | * **mod_id** - // | ||
- | * The id of the mod that is being unregistered | ||
- | |||
- | //Notes// | ||
- | Most of the time you will not need to unregister a mod. The mod will need to be re-registered anytime the addons are all reloaded and a new mod_id will be generated. If you're going to lose the mod_id and you need to re-register your mod without reloading Cherry Core, Then you will need to unregister the mod. | ||
- | |||
- | |||
- | === CherryConnect.Message === | ||
- | |||
- | Usage: | ||
- | < | ||
- | Sends a message to all clients that the user has allowed the message to be sent to. | ||
- | |||
- | * **mod_id** - // | ||
- | * The id of the mod that has been registered | ||
- | * **message** - // | ||
- | * The message to the user | ||
- | |||
- | **returns** | ||
- | |||
- | On errors: | ||
- | < | ||
- | { | ||
- | mode = result_modes.error, | ||
- | | ||
- | | ||
- | } | ||
- | </ | ||
- | // See below for possible error codes and messages// | ||
- | |||
- | |||
- | On success: | ||
- | < | ||
- | { | ||
- | mode = " | ||
- | | ||
- | } | ||
- | </ | ||
- | |||
- | //Notes// | ||
- | Sends a message to the user. This function does not allow a return function because there' | ||
- | |||
- | |||
- | === CherryConnect.MessageOptions === | ||
- | |||
- | Usage: | ||
- | < | ||
- | Sends a message that includes options that the user can select. | ||
- | |||
- | * **mod_id** - // | ||
- | * The id of the mod that has been registered. | ||
- | * **options** - // | ||
- | * A list of options that the user has to select from. The options are in the format of: {" | ||
- | * **message** - // | ||
- | * The message to the user. | ||
- | * **callback_func** - // | ||
- | * The function that gets called when the user selects an option. The function is in the format of: function(option, | ||
- | |||
- | **returns** | ||
- | |||
- | On errors: | ||
- | < | ||
- | { | ||
- | mode = result_modes.error, | ||
- | | ||
- | | ||
- | } | ||
- | </ | ||
- | // See below for possible error codes and messages// | ||
- | |||
- | |||
- | On success: | ||
- | < | ||
- | { | ||
- | mode = " | ||
- | | ||
- | } | ||
- | </ | ||
- | |||
- | //Notes// | ||
- | The option that is returned will exactly match one of the options that was sent. the callback_id should be immediately used when an option is selected. Some clients use this data to give the user ui feedback. | ||
- | |||
- | === CherryConnect.MessageResponse === | ||
- | |||
- | Usage: | ||
- | < | ||
- | Let's the user's client know That the option has been received successfully | ||
- | |||
- | * **mod_id** - // | ||
- | * The id of the mod that has been registered. | ||
- | * **callback_id** - // | ||
- | * The callback ID that was given from a successful option selection of the CherryConnect.MessageOptions function | ||
- | * **message** - // | ||
- | * A simple message to the user acknowledging that the option was selected. | ||
- | |||
- | **returns** | ||
- | |||
- | On errors: | ||
- | < | ||
- | { | ||
- | mode = result_modes.error, | ||
- | | ||
- | | ||
- | } | ||
- | </ | ||
- | // See below for possible error codes and messages// | ||
- | |||
- | |||
- | On success: | ||
- | < | ||
- | { | ||
- | mode = " | ||
- | | ||
- | } | ||
- | </ | ||
- | |||
- | //Notes// | ||
- | This should be used immediately after an option is selected from CherryConnect.MessageResponse to provide a good experience for the end user to understand that the option that they selected was acknowledged. | ||
- | |||
- | === Main Communication function === | ||
- | |||
- | The function that is passed to CherryConnect.Register will be the function that which most user messages and commands will be routed. The exception would be CherryConnect.MessageOptions where the user-selected option will be routed directly to the specially supplied function. | ||
- | |||
- | The When the user sends a message or command that is routed to cmd_func The signature will be function(result). The result will either be an error or a message result: | ||
- | |||
- | On errors: | ||
- | < | ||
- | { | ||
- | mode = result_modes.error, | ||
- | | ||
- | | ||
- | } | ||
- | </ | ||
- | // See below for possible error codes and messages// | ||
- | |||
- | |||
- | On success: | ||
- | < | ||
- | { | ||
- | mode = " | ||
- | | ||
- | } | ||
- | </ | ||
- | |||
- | |||
- | === Results & Errors === | ||
- | |||
- | **Result Modes** | ||
- | < | ||
- | result_modes = { | ||
- | | ||
- | | ||
- | error = " | ||
- | | ||
- | } | ||
- | </ | ||
- | |||
- | **Error Codes** | ||
- | < | ||
- | errors = { | ||
- | setting_commands = { | ||
- | error_code = 1001, | ||
- | message = "Error Setting Commands." | ||
- | }, | ||
- | missing_fields = { | ||
- | error_code = 1002, | ||
- | message = " | ||
- | }, | ||
- | mod_name_spaces = { | ||
- | error_code = 1003, | ||
- | message = "Mod name cannot contain spaces." | ||
- | }, | ||
- | cmdFunc_not_function = { | ||
- | error_code = 1004, | ||
- | message = " | ||
- | }, | ||
- | duplicate_mod = { | ||
- | error_code = 1005, | ||
- | message = "Mod already registered. Please use a different author / name combination." | ||
- | }, | ||
- | mod_not_found = { | ||
- | error_code = 1006, | ||
- | message = "Mod not found." | ||
- | }, | ||
- | id_not_supplied = { | ||
- | error_code = 1007, | ||
- | message = "ID not supplied." | ||
- | }, | ||
- | mod_not_allow_posting = { | ||
- | error_code = 1008, | ||
- | message = "Mod does not allow posting." | ||
- | }, | ||
- | message_not_supplied = { | ||
- | error_code = 1009, | ||
- | message = " | ||
- | }, | ||
- | no_registered_clients = { | ||
- | error_code = 1010, | ||
- | message = "The user has not registered any communication clients." | ||
- | }, | ||
- | } | ||
- | </ | ||
- | |||
- | |||
- | ==== Troubleshooting ==== | ||
- | |||
- | If you have any questions or need help, please visit the Cherry discord server: | ||
- | [[https:// |