mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-13 12:19:54 +01:00
nil pointer fun
This commit is contained in:
25
labersack.go
25
labersack.go
@@ -31,28 +31,29 @@ func SendAppointBroadcast(creator string, app *Appointment) {
|
||||
}
|
||||
|
||||
msgs := fmt.Sprintf("🗓️ New appointment for [%s](https://anime.hanami.family/anime/%d) at <t:%d:F> <t:%d:R>", anime.Title, app.Anime, app.Time.Unix(), app.Time.Unix())
|
||||
msgc := discordgo.MessageSend{
|
||||
Content: msgStart.String(),
|
||||
Embeds: []*discordgo.MessageEmbed{{
|
||||
Description: msgs,
|
||||
URL: fmt.Sprintf("https://anime.hanami.family/anime/%d", app.Anime),
|
||||
Thumbnail: &discordgo.MessageEmbedThumbnail{URL: anime.ImageLargeURL},
|
||||
Color: 7187428,
|
||||
Footer: &discordgo.MessageEmbedFooter{
|
||||
Text: "huso " + husoVersion,
|
||||
},
|
||||
}},
|
||||
msge := discordgo.MessageEmbed{
|
||||
Description: msgs,
|
||||
URL: fmt.Sprintf("https://anime.hanami.family/anime/%d", app.Anime),
|
||||
Thumbnail: &discordgo.MessageEmbedThumbnail{URL: anime.ImageLargeURL},
|
||||
Color: 7187428,
|
||||
Footer: &discordgo.MessageEmbedFooter{
|
||||
Text: "huso " + husoVersion,
|
||||
},
|
||||
}
|
||||
|
||||
user, _, err := GetUserData(creator)
|
||||
if err == nil {
|
||||
msgc.Embed.Author = &discordgo.MessageEmbedAuthor{
|
||||
msge.Author = &discordgo.MessageEmbedAuthor{
|
||||
Name: user.Username,
|
||||
IconURL: user.ImageURL,
|
||||
URL: fmt.Sprintf("https://anime.hanami.family/user/%s", creator),
|
||||
}
|
||||
}
|
||||
|
||||
msgc := discordgo.MessageSend{
|
||||
Content: msgStart.String(),
|
||||
Embeds: []*discordgo.MessageEmbed{&msge},
|
||||
}
|
||||
_, err = discc.ChannelMessageSendComplex("998277590609559632", &msgc)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user