Skip to content

Commit

Permalink
fix: centrum feed and add version to discord embeds
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <[email protected]>
  • Loading branch information
galexrt committed May 20, 2024
1 parent 02eef22 commit f50877d
Show file tree
Hide file tree
Showing 4 changed files with 245 additions and 227 deletions.
21 changes: 14 additions & 7 deletions pkg/discord/embeds/embeds.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
package embeds

import "github.com/bwmarrin/discordgo"

var EmbedAuthor = &discordgo.MessageEmbedAuthor{
Name: "FiveNet Discord Bot",
URL: "https://fivenet.app/",
IconURL: "https://raw.githubusercontent.com/fivenet-app/fivenet/main/src/public/images/logo-200x200.png",
}
import (
"github.com/bwmarrin/discordgo"
"github.com/fivenet-app/fivenet/pkg/version"
)

const (
ColorInfo = 5627360
ColorWarn = 16166445
ColorError = 14100024
ColorSuccess = 2346603
)

var EmbedAuthor = &discordgo.MessageEmbedAuthor{
Name: "FiveNet Discord Bot",
URL: "https://fivenet.app/",
IconURL: "https://raw.githubusercontent.com/fivenet-app/fivenet/main/src/public/images/logo-200x200.png",
}

var EmbedFooter = &discordgo.MessageEmbedFooter{
Text: "Version: " + version.Version,
}
2 changes: 2 additions & 0 deletions pkg/discord/guild.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ func (g *Guild) sendStartStatusLog(channelId string) error {
Title: "Starting sync...",
Author: embeds.EmbedAuthor,
Color: embeds.ColorInfo,
Footer: embeds.EmbedFooter,
}); err != nil {
return err
}
Expand Down Expand Up @@ -246,6 +247,7 @@ func (g *Guild) sendEndStatusLog(channelId string, duration time.Duration, errs
Description: fmt.Sprintf("Completed in %s.", duration),
Author: embeds.EmbedAuthor,
Color: embeds.ColorSuccess,
Footer: embeds.EmbedFooter,
})

if _, err := g.bot.discord.ChannelMessageSendEmbeds(channel.ID, logs); err != nil {
Expand Down
Loading

0 comments on commit f50877d

Please sign in to comment.