|
|
|
@ -80,19 +80,26 @@ func ReactListener(s *discordgo.Session, m *discordgo.MessageReactionAdd) {
|
|
|
|
|
m.GuildID, m.ChannelID, m.MessageID,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
msg, err = s.ChannelMessageSendEmbed(
|
|
|
|
|
config.StarChannel,
|
|
|
|
|
&discordgo.MessageEmbed{
|
|
|
|
|
Title: "Starred Message",
|
|
|
|
|
Description: content,
|
|
|
|
|
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",
|
|
|
|
|
},
|
|
|
|
|
embed := discordgo.MessageEmbed{
|
|
|
|
|
Title: "Starred Message",
|
|
|
|
|
Description: content,
|
|
|
|
|
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",
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
if len(msg.Embeds) > 0 && msg.Embeds[0].Image != nil {
|
|
|
|
|
img := msg.Embeds[0].Image
|
|
|
|
|
embed.Thumbnail = &discordgo.MessageEmbedThumbnail{
|
|
|
|
|
URL: img.URL,
|
|
|
|
|
ProxyURL: img.ProxyURL,
|
|
|
|
|
Width: img.Width,
|
|
|
|
|
Height: img.Height,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
msg, err = s.ChannelMessageSendEmbed(config.StarChannel, &embed)
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Error(s, "listenToStarboardReact", "channelMessageSendEmbed", err)
|
|
|
|
|
return
|
|
|
|
|