User Tools

Site Tools



discordchat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
discordchat [2019/04/05 05:55] mochidiscordchat [2019/04/22 09:13] (current) – [Custom Commands] mochi
Line 13: Line 13:
   * There may be up to a 2 second delay in sending messages from FF14 to Discord, and up to a 4 second delay in sending messages from Discord to FF14.   * There may be up to a 2 second delay in sending messages from FF14 to Discord, and up to a 4 second delay in sending messages from Discord to FF14.
   * Please follow all these instructions to set up the addon. **You can do all these setup steps without buying/installing the addon, and I would recommend doing so.**   * Please follow all these instructions to set up the addon. **You can do all these setup steps without buying/installing the addon, and I would recommend doing so.**
 +  * Auto-Translate phrases are not sent.
   * [[http://www.mmominion.com/thread-21514.html|Support Thread]]   * [[http://www.mmominion.com/thread-21514.html|Support Thread]]
 ---- ----
Line 45: Line 46:
   - Paste the bot token into the //Discord Chat// addon in MMOMinion, under //Bot Token/Channel//, in //Token//.   - Paste the bot token into the //Discord Chat// addon in MMOMinion, under //Bot Token/Channel//, in //Token//.
   - On the left side, go to //OAuth2//. Scroll down to //Scopes// and check //bot//.   - On the left side, go to //OAuth2//. Scroll down to //Scopes// and check //bot//.
 +  - Scroll down to //Bot Permissions// and check //View Channels// and //Send Messages//.
   - Copy the URL under the checkboxes in //Scopes// and visit the URL in your clipboard.   - Copy the URL under the checkboxes in //Scopes// and visit the URL in your clipboard.
   - Log-in to discord and authorize the bot to join your server.   - Log-in to discord and authorize the bot to join your server.
Line 54: Line 56:
 Each bot token needs to be activated once it's created, before it can be used by the //Discord Chat// addon. This only needs to be done once. This is to allow the token to send messages to the server, and the activation form below only sends your token to Discord. Each bot token needs to be activated once it's created, before it can be used by the //Discord Chat// addon. This only needs to be done once. This is to allow the token to send messages to the server, and the activation form below only sends your token to Discord.
  
-Paste the token into the form below, then hit //Activate//.+Paste the token into the form below, then hit //Activate//. Note that you must do this from your primary web browser, and not MMOMinion's built-in browser.
 <html> <html>
         <script>         <script>
Line 119: Line 121:
   * **Logging Level**: Defaulted to //0//. Increasing this will show more debug statements in console.   * **Logging Level**: Defaulted to //0//. Increasing this will show more debug statements in console.
  
-When an external addon registers itself with //DiscordChat//, it can be enabled or disabled under //External Plugins//+When an external addon registers itself with //DiscordChat//, the external addon's Discord usage can be enabled or disabled under //External Plugins// 
 + 
 +====== Advanced Channel Configuration ====== 
 +You can configure the addon to send messages in different chat channels in FF14 (such as Say, FC, LS1, LS4) to go to a different channel in Discord. 
 + 
 +You can create multiple channels in your Discord server, //Copy ID// in Discord, and paste them in the Channels configuration window. 
 + 
 +{{::channelcolors.png?nolink&400|}} 
 + 
 +You can also specify a hex color to distinguish between messages. For example, //ff0000// would give a red color, and //00ff00// would give a green color. You can use [[https://www.google.com/search?q=color+picker|any color picker to select colors]] in this format. 
 + 
 +{{::coloredchat.png?nolink&100|}} 
 + 
 +If you enable //(Experimental) Listen on channel//, you can enable //Listen// on channels in the //Channels// menu. This will let you reply directly in separate chat channels. 
 + 
 + 
 +====== Mention Keywords ====== 
 +You can specify specific keywords, that when said in chat, will notify you in discord with an //@// mention. These can be found under the //Bot Token/Channel// menu. Your User ID can be obtained by right clicking yourself on Discord's //Member List// and selecting //Copy ID// 
 + 
 + 
 +{{::mentionkeywords.png?nolink&400|}} 
 + 
 + 
 +====== Custom Commands ====== 
 +If you want to program your own commands and responses, you can program simple ones with custom commands. (You can more easily make complex ones using the public API in the next section.) 
 + 
 +Under //Custom Commands//, define a prefix, and a response. A return value will be send back to the channel the command was sent in. There are two additional commands you can use, //message// and //SendMessage//. //message// is the discord message that triggered the response (you can simply return this to see what the contents are), and //SendMessage// is a command to send additional messages beyond the return value. 
 + 
 +Here are two examples: 
 + 
 +**Returns your current HP** 
 + 
 +Prefix: hp 
 + 
 +Code: <code lua>return Player.hp.current</code> 
 + 
 +**Returns your current map and position** 
 + 
 +Prefix: pos 
 + 
 +Code: <code lua>return GetMapName(Player.localmapid)..": <"..Player.pos.x..", "..Player.pos.y..", "..Player.pos.z..">"</code> 
 + 
 +{{::customcommands.png?nolink&400|}}
  
 ====== Public API for Other Addons ====== ====== Public API for Other Addons ======
Line 191: Line 235:
 </code> </code>
  
 +The message passed into your registered callback looks something like this:
 +<code lua>
 +{
 + attachments = 
 + {
 + },
 + author = 
 + {
 + avatar = "...",
 + discriminator = "0000",
 + id = "...",
 + username = "(name)",
 + },
 + channel_id = "...",
 + content = "!test message",
 + embeds = 
 + {
 + },
 + id = "...",
 + mention_everyone = false,
 + mention_roles = 
 + {
 + },
 + mentions = 
 + {
 + },
 + pinned = false,
 + timestamp = "2019-04-05T05:56:35.531000+00:00",
 + tts = false,
 + type = 0,
 +}
 +
 +</code>
discordchat.1554443752.txt.gz · Last modified: 2019/04/05 05:55 by mochi