|
|
|
@ -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",
|
|
|
|
|