Skip to content

Package for sending Discord webhooks quickly and easily

License

Notifications You must be signed in to change notification settings

orewaee/disgohook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

disgohook

The disgohook package allows you to send Discord webhooks quickly and easily. It does not use any external libs and is implemented in pure Go.

📦 Installation

go get github.com/orewaee/disgohook

🤖 Simple example

The disgohook package uses builders to generate the correct webhook structure. For example, to send a message with an embed, you can do this:

package main

import (
	"github.com/orewaee/disgohook"
	"log"
)

func main() {
    embed := disgohook.
        NewEmbedBuilder().
        SetColor(0x5865f2).
        SetTitle("something very important").
        SetDescription("disgohook is already here :alien:").
        Build()
    
    webhook := disgohook.
        FromIdAndToken("your webhook id", "your webhook token").
        SetEmbeds(embed).
        Build()
    
    if err := webhook.Send(); err != nil {
        log.Fatalln(err)
    }
}