Sends report and ban messages straight to Discord

Supported Games

This plugin is for those who are unable to setup real discord bots or do not have the hardware for it. Discord Messages makes use of the webhook function of Discord therefore you do not need any dependencies to get up and running!

Features

All of these features can be enabled/disabled via the config.

  • Ban - (/ban) - Allows a player with permission to ban another player and have the message announced to the server and sent to discord, this replaces the vanilla ban command but works better in the way that it lets you ban offline players with simplicity.
  • Report - (/report) - Allows a player with permission to report another player and have their message sent to discord.
  • Mute Messages - (Requires Better Chat Mute) - When a player is muted via BetterChatMute a message is sent to Discord.
  • Message - (/message) - Allows a player with permission to send a message to Discord.
  • Server Chat - Posts to discord once a player types in chat with the option to enable TTS *(Text To Speech) *

Permissions

  • discordmessages.ban -- Allows player to use the ban command
  • discordmessages.report -- Allows player to use the report command
  • discordmessages.message -- Allowsplayer to use the message command

Commands

() = Required - {} = Optional

  • ban (player) {message} -- Ban player and send message to Discord
  • report (player) (message) -- Send a report to Discord
  • message (message) -- Send a message to Discord

Developer API

There are two API methods. APISendFancyMessage will send an Embedded message while APISendTextMessage will send a generic text message.

DiscordMessages?.Call("API_SendFancyMessage", (string)WebhookURL, (string)EmbedTitle, (int/string/Color)EmbedColor, (json string)Fields, (optional string)MessageText, (optional Plugin)Plugin);
DiscordMessages?.Call("API_SendTextMessage", (string)WebhookURL, (string)Message, (optional bool)TextToSpeech, (optional Plugin)Plugin);

In order to create the fields required for an Embedded message you simply create an fields object with an array of fields as follows.

object fields = new[]
{
  new {
    name = "Field1 Title", value = "Field1 Value", inline = true
  },
  new {
    name = "Field2 Title", value = "Field2 Value", inline = false
  }
};
string json = JsonConvert.SerializeObject(fields);
DiscordMessages?.Call("API_SendFancyMessage", (string)WebhookURL, (string)EmbedTitle, (int)EmbedColor, json);
    Download
    Donate
    3.6K downloads
    155 watchers

    discordbetterchat