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(checkPrestigeReact)
dg.AddHandler(starboardAutoReact)
dg.AddHandler(listenToStarboardReact)
err = dg.Open()
if err != nil {

@ -8,13 +8,6 @@ import (
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) {
if m.Emoji.Name != starEmoji {
return
@ -51,10 +44,11 @@ func listenToStarboardReact(s *discordgo.Session, m *discordgo.MessageReactionAd
_, err = s.ChannelMessageSendEmbed(
"645551408283648000",
&discordgo.MessageEmbed{
Title: "Starred Message",
URL: "https://discordapp.com/channels/" + m.GuildID + "/" + m.ChannelID + "/" + m.MessageID,
Color: color,
Timestamp: messageTimestamp.Format(time.RFC3339),
Title: "Starred Message",
Description: msg.Content,
URL: "https://discordapp.com/channels/" + m.GuildID + "/" + m.ChannelID + "/" + m.MessageID,
Color: color,
Timestamp: messageTimestamp.Format(time.RFC3339),
Author: &discordgo.MessageEmbedAuthor{
Name: msg.Author.Username + "#" + msg.Author.Discriminator,
IconURL: "https://cdn.discordapp.com/avatars/" + msg.Author.ID + "/" + msg.Author.Avatar + ".png",