https://github.com/gtuk/discordwebhook
Super simple interface to send discord messages through webhooks in golang
https://github.com/gtuk/discordwebhook
discord discord-webhook go golang notifications webhooks
Last synced: 5 months ago
JSON representation
Super simple interface to send discord messages through webhooks in golang
- Host: GitHub
- URL: https://github.com/gtuk/discordwebhook
- Owner: gtuk
- Created: 2021-05-31T16:15:40.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-12T22:32:44.000Z (over 2 years ago)
- Last Synced: 2025-07-02T05:07:52.500Z (12 months ago)
- Topics: discord, discord-webhook, go, golang, notifications, webhooks
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 39
- Watchers: 2
- Forks: 23
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Discord Webhook
This package provides a super simple interface to send discord messages through webhooks in golang.
### Installation
```
go get github.com/gtuk/discordwebhook
```
### Example
Below is the most basic example on how to send a message.
For a more advanced message structure see the structs in types.go and https://birdie0.github.io/discord-webhooks-guide/discord_webhook.html
```
package main
import "github.com/gtuk/discordwebhook"
func main() {
var username = "BotUser"
var content = "This is a test message"
var url = "https://discord.com/api/webhooks/..."
message := discordwebhook.Message{
Username: &username,
Content: &content,
}
err := discordwebhook.SendMessage(url, message)
if err != nil {
log.Fatal(err)
}
}
```
### TODO
* Tests
* Documentation