|
|
@ -4,34 +4,29 @@ import (
|
|
|
|
"github.com/bwmarrin/discordgo"
|
|
|
|
"github.com/bwmarrin/discordgo"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func SendSuccessEmbed(dg *discordgo.Session, channelID string, message string) {
|
|
|
|
func SendEmbed(dg *discordgo.Session, channelID string, embed *discordgo.MessageEmbed) {
|
|
|
|
_, err := dg.ChannelMessageSendEmbed(
|
|
|
|
_, err := dg.ChannelMessageSendEmbed(channelID, embed)
|
|
|
|
channelID,
|
|
|
|
|
|
|
|
&discordgo.MessageEmbed{
|
|
|
|
|
|
|
|
Title: "Success",
|
|
|
|
|
|
|
|
Description: message,
|
|
|
|
|
|
|
|
Color: 0x00D000,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
ReportError(dg, err)
|
|
|
|
ReportError(dg, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func SendSuccessEmbed(dg *discordgo.Session, channelID string, message string) {
|
|
|
|
|
|
|
|
SendEmbed(dg, channelID, &discordgo.MessageEmbed{
|
|
|
|
|
|
|
|
Title: "Success",
|
|
|
|
|
|
|
|
Description: message,
|
|
|
|
|
|
|
|
Color: 0x00D000,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func SendErrorEmbed(dg *discordgo.Session, channelID string, toSend error) {
|
|
|
|
func SendErrorEmbed(dg *discordgo.Session, channelID string, toSend error) {
|
|
|
|
SendFailEmbed(dg, channelID, "Error", toSend.Error())
|
|
|
|
SendFailEmbed(dg, channelID, "Error", toSend.Error())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func SendFailEmbed(dg *discordgo.Session, channelID string, title string, description string) {
|
|
|
|
func SendFailEmbed(dg *discordgo.Session, channelID string, title string, description string) {
|
|
|
|
_, err := dg.ChannelMessageSendEmbed(
|
|
|
|
SendEmbed(dg, channelID, &discordgo.MessageEmbed{
|
|
|
|
channelID,
|
|
|
|
Title: title,
|
|
|
|
&discordgo.MessageEmbed{
|
|
|
|
Description: description,
|
|
|
|
Title: title,
|
|
|
|
Color: 0xD00000,
|
|
|
|
Description: description,
|
|
|
|
})
|
|
|
|
Color: 0xD00000,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
ReportError(dg, err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|