Features: Fix server creation time

master
Marc Egerton 2020-12-29 21:41:18 +00:00
parent bc1a7952a3
commit 83f462449a
1 changed files with 6 additions and 4 deletions

View File

@ -673,12 +673,14 @@ func (f *Features) handleServerInfo(s *discordgo.Session, m *discordgo.MessageCr
chans, _ := s.GuildChannels(f.Config.GuildID)
sChannels := strconv.Itoa(len(chans))
sEmojis := strconv.Itoa(len(g.Emojis))
sRoles := strconv.Itoa(len(g.Roles))
sRegion := g.Region
sJoinedAt, _ := g.JoinedAt.Parse()
iID, _ := strconv.Atoi(f.Config.GuildID)
createdMSecs := ((iID / 4194304) + 1420070400000) / 1000
sCreatedAt := time.Unix(int64(createdMSecs), 0).Format(time.RFC1123)
sIconURL := g.IconURL()
user := m.Author
@ -689,7 +691,7 @@ func (f *Features) handleServerInfo(s *discordgo.Session, m *discordgo.MessageCr
desc += "**Server Emojis**: `" + sEmojis + "`\n"
desc += "**Server Roles**: `" + sRoles + "`\n"
desc += "**Server Region**: `" + sRegion + "`\n"
desc += "**Server Creation**: `" + sJoinedAt.Format(time.RFC1123) + "`\n"
desc += "**Server Creation**: `" + sCreatedAt + "`\n"
embedData := models.CustomEmbed{
URL: "",