package lib import ( "bytes" "encoding/json" "net/http" ) type DiscordSender struct { Webhook string Fake bool } func (d DiscordSender) Send(msg string) { b, _ := json.Marshal(map[string]string{"content": msg}) if d.Fake { return } http.Post(d.Webhook, "application/json", bytes.NewBuffer(b)) } func (d DiscordSender) SendBatch(msgs []string) { for _, msg := range msgs { d.Send(msg) } }