Documentation
¶
Overview ¶
Package discord
This package provides programatic access to discord messages integrated with GoMud.
References: https://leovoel.github.io/embed-visualizer/ https://birdie0.github.io/discord-webhooks-guide/discord_webhook.html https://gist.github.com/rxaviers/7360908
Index ¶
- Constants
- Variables
- func HandleAuctionUpdate(e events.Event) events.ListenerReturn
- func HandleBroadcast(e events.Event) events.ListenerReturn
- func HandleDeath(e events.Event) events.ListenerReturn
- func HandleLevelup(e events.Event) events.ListenerReturn
- func HandleLogs(e events.Event) events.ListenerReturn
- func HandlePlayerDespawn(e events.Event) events.ListenerReturn
- func HandlePlayerSpawn(e events.Event) events.ListenerReturn
- func Init(webhookUrl string)
- func SendMessage(message string)
- func SendPayload(payload webHookPayload)
- func SendRichMessage(message string, color Color)
- type Color
Constants ¶
View Source
const (
RequestFailureBackoffSeconds = 30
)
Variables ¶
View Source
var (
WebhookUrl string
)
Functions ¶
func HandleAuctionUpdate ¶
func HandleAuctionUpdate(e events.Event) events.ListenerReturn
func HandleBroadcast ¶
func HandleBroadcast(e events.Event) events.ListenerReturn
func HandleDeath ¶
func HandleDeath(e events.Event) events.ListenerReturn
func HandleLevelup ¶
func HandleLevelup(e events.Event) events.ListenerReturn
func HandleLogs ¶
func HandleLogs(e events.Event) events.ListenerReturn
func HandlePlayerDespawn ¶
func HandlePlayerDespawn(e events.Event) events.ListenerReturn
Player leaves the world event
func HandlePlayerSpawn ¶
func HandlePlayerSpawn(e events.Event) events.ListenerReturn
Player enters the world event
func Init ¶
func Init(webhookUrl string)
Initializes and sets the webhook so we can send messages to discord and registers listeners to listen for events
func SendRichMessage ¶
Sends an embed message to discord which includes a colored bar to the left hexColor should be specified as a string in this format "#000000"
Types ¶
type Color ¶
type Color int
const ( Default Color = 0 // #000000 Aqua Color = 1752220 // #1ABC9C DarkAqua Color = 1146986 // #11806A Green Color = 5763719 // #57F287 DarkGreen Color = 2067276 // #1F8B4C Blue Color = 3447003 // #3498DB DarkBlue Color = 2123412 // #206694 Purple Color = 10181046 // #9B59B6 DarkPurple Color = 7419530 // #71368A LuminousVividPink Color = 15277667 // #E91E63 DarkVividPink Color = 11342935 // #AD1457 Gold Color = 15844367 // #F1C40F DarkGold Color = 12745742 // #C27C0E Orange Color = 15105570 // #E67E22 DarkOrange Color = 11027200 // #A84300 Red Color = 15548997 // #ED4245 DarkRed Color = 10038562 // #992D22 Grey Color = 9807270 // #95A5A6 DarkGrey Color = 9936031 // #979C9F DarkerGrey Color = 8359053 // #7F8C8D LightGrey Color = 12370112 // #BCC0C0 Yellow Color = 16776960 // #FFFF00 )
Click to show internal directories.
Click to hide internal directories.