Big cleanup 🧹

This commit is contained in:
daru
2022-07-28 00:43:35 +02:00
parent 6a2e573828
commit 1bb8536334
5 changed files with 49 additions and 133 deletions

View File

@@ -30,10 +30,10 @@ func SendAppointBroadcast(creator string, app *Appointment) {
msgStart.WriteString(fmt.Sprintf("<@%d>", uData.DiscordID))
}
msgs := fmt.Sprintf("🗓️ New appointment for [%s](https://anime.hanami.family/anime/%d) at\n<t:%d:F>\n<t:%d:R>", anime.Title, app.Anime, app.Time.Unix(), app.Time.Unix())
msgs := fmt.Sprintf("🗓️ New appointment for [%s](%s%d) at\n<t:%d:F>\n<t:%d:R>", anime.Title, *husoWebAnimeUri, app.Anime, app.Time.Unix(), app.Time.Unix())
msge := discordgo.MessageEmbed{
Description: msgs,
URL: fmt.Sprintf("https://anime.hanami.family/anime/%d", app.Anime),
URL: fmt.Sprintf("%s%d", *husoWebAnimeUri, app.Anime),
Thumbnail: &discordgo.MessageEmbedThumbnail{URL: anime.ImageLargeURL},
Color: 7187428,
Footer: &discordgo.MessageEmbedFooter{
@@ -46,7 +46,7 @@ func SendAppointBroadcast(creator string, app *Appointment) {
msge.Author = &discordgo.MessageEmbedAuthor{
Name: user.Username,
IconURL: user.ImageURL,
URL: fmt.Sprintf("https://anime.hanami.family/user/%s", creator),
URL: fmt.Sprintf("%s%s", *husoWebUserUri, creator),
}
}
@@ -54,7 +54,7 @@ func SendAppointBroadcast(creator string, app *Appointment) {
Content: msgStart.String(),
Embeds: []*discordgo.MessageEmbed{&msge},
}
_, err = discc.ChannelMessageSendComplex("998277590609559632", &msgc)
_, err = discc.ChannelMessageSendComplex(*discordChannel, &msgc)
if err != nil {
color.Errorln(err.Error())
@@ -84,10 +84,10 @@ func AnnounceAppointmentSoon(app *Appointment) {
msgStart.WriteString(fmt.Sprintf("<@%d>", uData.DiscordID))
}
msgs := fmt.Sprintf("⏰ Appointment starting <t:%d:R>!\n[%s](https://anime.hanami.family/anime/%d) at\n<t:%d:F>", app.Time.Unix(), anime.Title, app.Anime, app.Time.Unix())
msgs := fmt.Sprintf("⏰ Appointment starting <t:%d:R>!\n[%s](%s%d) at\n<t:%d:F>", app.Time.Unix(), anime.Title, *husoWebAnimeUri, app.Anime, app.Time.Unix())
msge := discordgo.MessageEmbed{
Description: msgs,
URL: fmt.Sprintf("https://anime.hanami.family/anime/%d", app.Anime),
URL: fmt.Sprintf("%s%d", *husoWebAnimeUri, app.Anime),
Thumbnail: &discordgo.MessageEmbedThumbnail{URL: anime.ImageLargeURL},
Color: 7187428,
Footer: &discordgo.MessageEmbedFooter{
@@ -99,7 +99,7 @@ func AnnounceAppointmentSoon(app *Appointment) {
Content: msgStart.String(),
Embeds: []*discordgo.MessageEmbed{&msge},
}
_, err = discc.ChannelMessageSendComplex("998277590609559632", &msgc)
_, err = discc.ChannelMessageSendComplex(*discordChannel, &msgc)
if err != nil {
color.Errorln(err.Error())