|
|
@ -7,8 +7,12 @@ import (
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const starEmoji = "⭐"
|
|
|
|
const starEmoji = "⭐"
|
|
|
|
|
|
|
|
const starChannel = "645551408283648000"
|
|
|
|
|
|
|
|
|
|
|
|
func listenToStarboardReact(s *discordgo.Session, m *discordgo.MessageReactionAdd) {
|
|
|
|
func listenToStarboardReact(s *discordgo.Session, m *discordgo.MessageReactionAdd) {
|
|
|
|
|
|
|
|
if m.ChannelID == starChannel {
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
if m.Emoji.Name != starEmoji {
|
|
|
|
if m.Emoji.Name != starEmoji {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -41,8 +45,8 @@ func listenToStarboardReact(s *discordgo.Session, m *discordgo.MessageReactionAd
|
|
|
|
//White as fallback
|
|
|
|
//White as fallback
|
|
|
|
color = 0xFFFFFF
|
|
|
|
color = 0xFFFFFF
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_, err = s.ChannelMessageSendEmbed(
|
|
|
|
msg, err = s.ChannelMessageSendEmbed(
|
|
|
|
"645551408283648000",
|
|
|
|
starChannel,
|
|
|
|
&discordgo.MessageEmbed{
|
|
|
|
&discordgo.MessageEmbed{
|
|
|
|
Title: "Starred Message",
|
|
|
|
Title: "Starred Message",
|
|
|
|
Description: msg.Content,
|
|
|
|
Description: msg.Content,
|
|
|
@ -57,5 +61,10 @@ func listenToStarboardReact(s *discordgo.Session, m *discordgo.MessageReactionAd
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
logError(s, "listenToStarboardReact", "channelMessageSendEmbed", err)
|
|
|
|
logError(s, "listenToStarboardReact", "channelMessageSendEmbed", err)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
err = s.MessageReactionAdd(msg.ChannelID, msg.ID, starEmoji)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
logError(s, "listenToStarboardReact", "messageReactionAdd", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|