⚠⚠⚠THIS PACKAGE WAS MOVED TO HERE⚠⚠⚠
DisgoHook is a simple Discord Webhook library written in Go aimed to be easy to use
With v1 of disgo webhook support will be included there & this repo will be archived
go get github.com/DisgoOrg/disgohook
Import the package into your project.
import "github.com/DisgoOrg/disgohook"
Create a new Webhook by webhook_id/webhook_token
. (This WebhookClient should be only created once as it holds important state)
As first param you can optionally pass your own *http.Client and as second parameter you can pass your own logger implementing this interface. This webhook then can be used to send, edit and delete messages
webhook, err := disgohook.NewWebhookClientByToken(nil, nil, "webhook_id/webhook_token")
message, err := webhook.SendContent("hello world!")
message, err := webhook.SendEmbeds(api.NewEmbedBuilder().
SetDescription("hello world!").
Build(),
)
message, err := webhook.SendMessage(api.NewWebhookMessageCreateBuilder().
SetContent("hello world!").
Build(),
)
webhook, err := disgohook.NewWebhookClientByToken(nil, nil, "webhook_id/webhook_token")
message, err := webhook.EditContent("870741249114652722", "hello world!")
message, err := webhook.EditEmbeds("870741249114652722",
api.NewEmbedBuilder().
SetDescription("hello world!").
Build(),
)
message, err := webhook.EditMessage("870741249114652722",
api.NewWebhookMessageUpdateBuilder().
SetContent("hello world!").
Build(),
)
webhook, err := disgohook.NewWebhookClientByToken(nil, nil, "webhook_id/webhook_token")
err := webhook.DeleteMessage("870741249114652722")
Documentation is unfinished and can be found under
You can find examples under example and dislog
For help feel free to open an issues or reach out on Discord
Contributions are welcomed but for bigger changes please first reach out via Discord or create an issue to discuss your intentions and ideas.