mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-15 19:49:53 +01:00
💣💣💣
This commit is contained in:
16
labersack.go
16
labersack.go
@@ -63,19 +63,19 @@ func SendAppointBroadcast(creator string, app *Appointment) {
|
||||
}
|
||||
}
|
||||
|
||||
func AnnounceBomb(app *Appointment, timer time.Duration) {
|
||||
func AnnounceBomb(animeId, meetingUnix int64, timer time.Duration) {
|
||||
time.Sleep(timer)
|
||||
AnnounceAppointmentSoon(app)
|
||||
AnnounceAppointmentSoon(animeId, meetingUnix)
|
||||
}
|
||||
|
||||
func AnnounceAppointmentSoon(app *Appointment) {
|
||||
if app != nil && discc != nil {
|
||||
watchData, err := GetAnimeWatchFromDb(app.Anime)
|
||||
func AnnounceAppointmentSoon(animeId, meetingUnix int64) {
|
||||
if animeId != 0 && discc != nil {
|
||||
watchData, err := GetAnimeWatchFromDb(animeId)
|
||||
if err != nil {
|
||||
color.Errorln(err.Error())
|
||||
return
|
||||
}
|
||||
anime, err := SearchAnime(app.Anime)
|
||||
anime, err := SearchAnime(animeId)
|
||||
if err != nil {
|
||||
color.Errorln(err.Error())
|
||||
return
|
||||
@@ -90,10 +90,10 @@ func AnnounceAppointmentSoon(app *Appointment) {
|
||||
msgStart.WriteString(fmt.Sprintf("<@%d>", uData.DiscordID))
|
||||
}
|
||||
|
||||
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())
|
||||
msgs := fmt.Sprintf("⏰ Appointment starting <t:%d:R>!\n[%s](%s%d) at\n<t:%d:F>", meetingUnix, anime.Title, *husoWebAnimeUri, animeId, meetingUnix)
|
||||
msge := discordgo.MessageEmbed{
|
||||
Description: msgs,
|
||||
URL: fmt.Sprintf("%s%d", *husoWebAnimeUri, app.Anime),
|
||||
URL: fmt.Sprintf("%s%d", *husoWebAnimeUri, animeId),
|
||||
Thumbnail: &discordgo.MessageEmbedThumbnail{URL: anime.ImageLargeURL},
|
||||
Color: 7187428,
|
||||
Footer: &discordgo.MessageEmbedFooter{
|
||||
|
||||
Reference in New Issue
Block a user