darius 1592192b01 Added Stop command
improved init command
improved error handler
2024-05-03 22:37:29 +02:00

28 lines
539 B
Go

package services
import (
"fmt"
"github.com/bwmarrin/discordgo"
"strconv"
"time"
)
func HandleError(err error, s *discordgo.Session) {
_, err = s.ChannelMessageSendComplex(strconv.Itoa(1236038688627101749), &discordgo.MessageSend{
Content: "@here",
Embed: &discordgo.MessageEmbed{
Title: "Error",
Color: 0xff0000,
Timestamp: time.Now().Format(time.RFC3339),
Fields: []*discordgo.MessageEmbedField{
{
Value: "```" + err.Error() + "```",
},
},
},
})
if err != nil {
fmt.Println(err)
}
}