Relays - Maxopoly/Kira GitHub Wiki

Relays allow you to relay chat and snitch alerts of a NameLayer group to discord. Only one relay may exist at once for a group.

Creating a relay

To create a relay for a group you need the permission "KIRA_MANAGE_CHANNEL" for the group. By default only owners have this permission.

In the official discord

Run the command linkdiscordchannel [groupName] INGAME. A channel will be automatically created and all group members with the "READ_CHAT" permission will automatically be given access to it. You will be pinged in the channel once its creation has completed.

For private discords

Use the command ìnvite to obtain an invite which allows you to add Kira to your private discord. Give Kira access to the channel you want it to relay to including both read and write permissions. Run createrelayhere [groupName] in the channel you want Kira to relay to and a relay will be setup with a default configuration.

Configuring a relay

Every relay has a configuration. A configuration may be used by as many relays as you want. A configuration called default is preprovided, new relays use it by default

Creating a relay config

Run the command createrelayconfig [name] to create a new relay config with the given name and default values

Editing a relay config

The current configuration for a relay can be displayed by running relayconfig [name], this can be run by anyone for any relay config. It can be modified by commands following the pattern relayconfig [name] [property] [value] where value may also contain spaces and is just the remainder of the command. For example relayconfig myconfig showsnitches false. Only the owner of a config can modify it, but anyone may view its values or use it.

Configurable properties are:

chatToDiscord

Whether chat messages written in group chat ingame should be shown in Discord. Must be true or false, defaults to true.

chatFromDiscord

Whether chat messages written in Discord in the relay channel should be relayed to ingame. Must be true or false, defaults to true.

showSnitches

Whether snitch alerts of snitches on this group are shown in Discord. Must be true or false, defaults to true.

deleteMessages

Whether messages sent to this relays discord channel by members should be automatically deleted. Enabling this makes sense if you are relaying chat in both directions to avoid spamming your channel with duplicate messages. Ensure that Kira has the permission to delete messages if you want to use this! Must be true or false, defaults to true.

timeFormat

The format used for time stamps in snitch alerts and chat messages. See here under "Patterns for Formatting and Parsing" for detailed information on allowed patterns. The default time format is HH:mm:ss.

chatFormat

The format used when displaying group chat messages in Discord. This message is automatically populated with the values of the specific message by replacing the following specific identifiers:

  • %PLAYER% will be replaced with the name of the player who sent the message
  • %MESSAGE% will be replaced with the content of the message
  • %GROUP% will be replaced with the name of the group
  • %TIME% will be replaced with the current time according to the configured timeFormat
  • %PING% will be replaced with the highest priority ping contained in the message or triggered via regex

Any string with less than 512 characters is allowed here, the default chat format is `[%TIME%]` `[%GROUP%]` **[%PLAYER%]** %MESSAGE% %PING%

snitchFormat

The format used when displaying snitch alerts in Discord. This message is automatically populated with the values of the specific alert by replacing the following specific identifiers:

  • %PLAYER% will be replaced with the name of the player who hit the snitch
  • %SNITCH% will be replaced with the name of the snitch
  • %GROUP% will be replaced with the name of the group
  • %TIME% will be replaced with the current time according to the configured timeFormat
  • %ACTION% will be replaced with the configured string for what the player did (entering, logging in or logging out) as set in loginString, logoutString and enterString.
  • %PING% will be replaced with the highest priority ping contained in the message or triggered via regex

Any string with less than 512 characters is allowed here, the default snitch format is `[%TIME%]` `[%GROUP%]` **%PLAYER%** %ACTION% at %SNITCH% (%X%,%Y%,%Z%) %PING%

snitchloginmessage

The format used to replace %ACTION% in snitch alerts if the player logged in next to the snitch. Accepts any string shorter than 256 characters and defaults to logged in.

snitchlogoutmessage

The format used to replace %ACTION% in snitch alerts if the player logged out next to the snitch. Accepts any string shorter than 256 characters and defaults to logged out.

snitchentermessage

The format used to replace %ACTION% in snitch alerts if the player entered the snitch range. Accepts any string shorter than 256 characters and defaults to is.

hereFormat

The regex used to trigger @here pings in Discord. If any sub string of a chat message or a snitch alert post inserting values matches this regex, %PING% will be replaced with an @here ping. See here for the exact regex specification used and use this to test your regexes. This parameter only accepts valid regexes and defaults to @here.

skynetenabled

Relays have the ability to broadcast all logins/logouts from the servers. This functionality is referred to as 'Skynet' in the following and can be toggled on/off using this setting. Must be true or false, defaults to false.

skynetformat

The format used when displaying Skynet messages in Discord. This message is automatically populated with the values of the specific message by replacing the following specific identifiers:

  • %PLAYER% will be replaced with the name of the player who logged in/out
  • %TIME% will be replaced with the current time according to the configured timeFormat
  • %ACTION% will be replaced with the configured string for what the player did (login/logout)

Any string with less than 512 characters is allowed here, the default Skynet format is `[%TIME%]` **%PLAYER%** %ACTION%

skynetloginformat

The format used to replace %ACTION% in Skynet messages if the player logged in. Accepts any string shorter than 256 characters and defaults to logged in.

skynetlogoutformat

The format used to replace %ACTION% in Skynet messages if the player logged out. Accepts any string shorter than 256 characters and defaults to logged out.

newPlayerEnabled

Relays have the ability to broadcast when a new player first logs in to the server. This functionality can be toggled on/off using this setting. Must be true or false, defaults to false.

newPlayerFormat

The format used when displaying new player announcements in Discord. This message is automatically populated with the values of the specific message by replacing the following specific identifiers:

  • %PLAYER% will be replaced with the name of the player who logged in for the first time
  • %TIME% will be replaced with the current time according to the configured timeFormat

Any string with less than 512 characters is allowed here, the default format is `[%TIME%]` **%PLAYER%** is brand new!

everyoneFormat

The regex used to trigger @everyone pings in Discord. If any sub string of a chat message or a snitch alert post inserting values matches this regex, %PING% will be replaced with an @everyone ping. See here for the exact regex specification used and use this to test your regexes. This parameter only accepts valid regexes and defaults to @here.

shouldPing

Whether the relay is allowed to issue @here and @everyone pings. If set to false any existing @here and @everyone in messages/alerts will be removed. This includes both preexisting ones in snitch names or chat messages and the ones explicitly triggered via hereFormat or everyoneFormat. Additionally ensure that Kira has permissions to ping if your channel is in a private discord and you want it to ping. Must be true or false, defaults to false.

Setting a relays config

To change the config of a relay you need the permission KIRA_MANAGE_CHANNEL on the NameLayer group the relay is tied to. Assuming you have that you can run setrelayconfig [groupName] [relayName] to set the config for a relay. No specific permission for the relay config is required, all relay configs are public and may be used by anyone.

Deleting relays

To delete a relay run the command deleterelay [groupName]. You will need the permission KIRA_MANAGE_CHANNEL on the group to do this.