Add NewCalendar helper, make timezone string constant, add version constant

This commit is contained in:
2024-01-28 05:03:35 -06:00
parent 6ccc00eda3
commit 3f98a5d5d6
2 changed files with 15 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ import (
"strings"
"time"
ics "github.com/arran4/golang-ical"
"github.com/bwmarrin/discordgo"
"github.com/rs/zerolog"
log "github.com/rs/zerolog/log"
@@ -327,3 +328,13 @@ func GetFooter(time time.Time) *discordgo.MessageEmbedFooter {
Text: fmt.Sprintf("Fetched at %s", time.Format("Monday, January 2, 2006 at 3:04:05PM")),
}
}
func NewCalendar() *ics.Calendar {
c := &ics.Calendar{
Components: []ics.Component{},
CalendarProperties: []ics.CalendarProperty{},
}
c.SetVersion(Version)
c.SetProductId("-//xevion//Banner Discord Bot//EN")
return c
}