starboard: Don't star every message and fix embed

master
Luther Wen Xu 2019-11-20 16:24:14 +07:00
parent 46cee1af47
commit 538583c6db
Signed by: chanbakjsd
GPG Key ID: B7D77E3E9D102B70
2 changed files with 5 additions and 12 deletions

@ -21,7 +21,6 @@ func main() {
} }
dg.AddHandler(messageCreate) dg.AddHandler(messageCreate)
dg.AddHandler(checkPrestigeReact) dg.AddHandler(checkPrestigeReact)
dg.AddHandler(starboardAutoReact)
dg.AddHandler(listenToStarboardReact) dg.AddHandler(listenToStarboardReact)
err = dg.Open() err = dg.Open()
if err != nil { if err != nil {

@ -8,13 +8,6 @@ import (
const starEmoji = "⭐" const starEmoji = "⭐"
func starboardAutoReact(s *discordgo.Session, m *discordgo.MessageCreate) {
err := s.MessageReactionAdd(m.ChannelID, m.ID, starEmoji)
if err != nil {
logError(s, "starboardAutoReact", m.ChannelID, m.ID, err)
}
}
func listenToStarboardReact(s *discordgo.Session, m *discordgo.MessageReactionAdd) { func listenToStarboardReact(s *discordgo.Session, m *discordgo.MessageReactionAdd) {
if m.Emoji.Name != starEmoji { if m.Emoji.Name != starEmoji {
return return
@ -52,6 +45,7 @@ func listenToStarboardReact(s *discordgo.Session, m *discordgo.MessageReactionAd
"645551408283648000", "645551408283648000",
&discordgo.MessageEmbed{ &discordgo.MessageEmbed{
Title: "Starred Message", Title: "Starred Message",
Description: msg.Content,
URL: "https://discordapp.com/channels/" + m.GuildID + "/" + m.ChannelID + "/" + m.MessageID, URL: "https://discordapp.com/channels/" + m.GuildID + "/" + m.ChannelID + "/" + m.MessageID,
Color: color, Color: color,
Timestamp: messageTimestamp.Format(time.RFC3339), Timestamp: messageTimestamp.Format(time.RFC3339),