Skip to content

Commit

Permalink
Misc fixes to comply with updated version of DiscordGo
Browse files Browse the repository at this point in the history
  • Loading branch information
ReeceDonovan committed Feb 22, 2024
1 parent e234b48 commit b3b33a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/announcements.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func getAnnouncements(w http.ResponseWriter, r *http.Request) {
// Get other messages from public announcements.
for _, message := range publicAnnounce {
if message.Author.ID != session.State.User.ID && len(message.Content) > viper.GetInt("api.public_message_cutoff") {
date, err := message.Timestamp.Parse()
date, err := time.Parse(time.RFC3339, message.Timestamp.String())
if err != nil {
log.WithError(err).Error("Message time parse fail")
return
Expand Down
4 changes: 2 additions & 2 deletions commands/nitroCommands.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func nitroAnnounce(s *discordgo.Session, m *discordgo.MessageCreate) {

func boostersCommand(ctx context.Context, s *discordgo.Session, i *discordgo.InteractionCreate) {
servers := viper.Get("discord.servers").(*config.Servers)
if err := s.RequestGuildMembers(servers.PublicServer, "", 0, false); err != nil {
if err := s.RequestGuildMembers(servers.PublicServer, "", 0, "", false); err != nil {
log.WithContext(ctx).WithError(err).Error("Couldn't query server members")
return
}
Expand All @@ -33,7 +33,7 @@ func boostersCommand(ctx context.Context, s *discordgo.Session, i *discordgo.Int
}
boosters := []*discordgo.Member{}
for _, member := range guild.Members {
if len(member.PremiumSince) > 0 {
if member.PremiumSince != nil && !member.PremiumSince.IsZero() {
boosters = append(boosters, member)
}
}
Expand Down
4 changes: 2 additions & 2 deletions commands/upCommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ func checkStatuses(s *discordgo.Session, i *discordgo.InteractionCreate, sites [
emb = emb.AddField(title, fmt.Sprintf("Up: %v\nLatency: %dms\nError: %+v", result.Success, result.Time, result.Error))
}

_, err = s.InteractionResponseEdit(s.State.User.ID, i.Interaction, &discordgo.WebhookEdit{
Embeds: []*discordgo.MessageEmbed{emb.MessageEmbed},
_, err = s.InteractionResponseEdit(i.Interaction, &discordgo.WebhookEdit{
Embeds: &[]*discordgo.MessageEmbed{emb.MessageEmbed},
})
if err != nil {
log.WithError(err)
Expand Down

0 comments on commit b3b33a5

Please sign in to comment.