mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-15 19:29:52 +01:00
💣💣💣
This commit is contained in:
2
huso.go
2
huso.go
@@ -20,7 +20,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
husoVersion = "1.5"
|
husoVersion = "1.6"
|
||||||
registerSecret = "綾波レイ"
|
registerSecret = "綾波レイ"
|
||||||
seasonStrJikan = "seasons/"
|
seasonStrJikan = "seasons/"
|
||||||
userApiJikan = "users/"
|
userApiJikan = "users/"
|
||||||
|
|||||||
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)
|
time.Sleep(timer)
|
||||||
AnnounceAppointmentSoon(app)
|
AnnounceAppointmentSoon(animeId, meetingUnix)
|
||||||
}
|
}
|
||||||
|
|
||||||
func AnnounceAppointmentSoon(app *Appointment) {
|
func AnnounceAppointmentSoon(animeId, meetingUnix int64) {
|
||||||
if app != nil && discc != nil {
|
if animeId != 0 && discc != nil {
|
||||||
watchData, err := GetAnimeWatchFromDb(app.Anime)
|
watchData, err := GetAnimeWatchFromDb(animeId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
color.Errorln(err.Error())
|
color.Errorln(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
anime, err := SearchAnime(app.Anime)
|
anime, err := SearchAnime(animeId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
color.Errorln(err.Error())
|
color.Errorln(err.Error())
|
||||||
return
|
return
|
||||||
@@ -90,10 +90,10 @@ func AnnounceAppointmentSoon(app *Appointment) {
|
|||||||
msgStart.WriteString(fmt.Sprintf("<@%d>", uData.DiscordID))
|
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{
|
msge := discordgo.MessageEmbed{
|
||||||
Description: msgs,
|
Description: msgs,
|
||||||
URL: fmt.Sprintf("%s%d", *husoWebAnimeUri, app.Anime),
|
URL: fmt.Sprintf("%s%d", *husoWebAnimeUri, animeId),
|
||||||
Thumbnail: &discordgo.MessageEmbedThumbnail{URL: anime.ImageLargeURL},
|
Thumbnail: &discordgo.MessageEmbedThumbnail{URL: anime.ImageLargeURL},
|
||||||
Color: 7187428,
|
Color: 7187428,
|
||||||
Footer: &discordgo.MessageEmbedFooter{
|
Footer: &discordgo.MessageEmbedFooter{
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ func Arbeit() {
|
|||||||
} else {
|
} else {
|
||||||
cleared++
|
cleared++
|
||||||
}
|
}
|
||||||
} else if time.Now().Add(20*time.Minute).Before(a.Time) && time.Now().Add(40*time.Minute).After(a.Time) {
|
} else if time.Now().Add(40*time.Minute).Before(a.Time) && time.Now().Add(60*time.Minute).After(a.Time) {
|
||||||
// This has not happened and is happening soon
|
// This has not happened and is happening soon
|
||||||
go AnnounceBomb(&a, time.Until(a.Time.Add(-20*time.Minute)))
|
go AnnounceBomb(a.Anime, a.Time.Unix(), time.Until(a.Time.Add(-25*time.Minute)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if cleared > 0 {
|
if cleared > 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user