mirror of
https://github.com/jackmerrill/hampbot.git
synced 2024-12-04 13:02:59 -08:00
add embed images
This commit is contained in:
parent
41eec1f536
commit
40f286f29d
|
@ -38,6 +38,14 @@ func (l *MessageDeleteListener) Exec(s *discordgo.Session, e *discordgo.MessageD
|
|||
Inline: true,
|
||||
})
|
||||
|
||||
var image *discordgo.MessageEmbedImage
|
||||
|
||||
if len(msg.Attachments) > 0 {
|
||||
image = &discordgo.MessageEmbedImage{
|
||||
URL: msg.Attachments[0].URL,
|
||||
}
|
||||
}
|
||||
|
||||
_, err := s.ChannelMessageSendComplex(CHANNEL_ID, &discordgo.MessageSend{
|
||||
Content: "Message deleted",
|
||||
Embed: &discordgo.MessageEmbed{
|
||||
|
@ -45,6 +53,7 @@ func (l *MessageDeleteListener) Exec(s *discordgo.Session, e *discordgo.MessageD
|
|||
Description: msg.Content,
|
||||
Fields: fields,
|
||||
Color: 0xff0000,
|
||||
Image: image,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
@ -43,11 +43,20 @@ func (l *MessageEditListener) Exec(s *discordgo.Session, e *discordgo.MessageUpd
|
|||
Inline: false,
|
||||
})
|
||||
|
||||
var image *discordgo.MessageEmbedImage
|
||||
|
||||
if len(e.Attachments) > 0 {
|
||||
image = &discordgo.MessageEmbedImage{
|
||||
URL: e.Attachments[0].URL,
|
||||
}
|
||||
}
|
||||
|
||||
_, err := s.ChannelMessageSendComplex(CHANNEL_ID, &discordgo.MessageSend{
|
||||
Embed: &discordgo.MessageEmbed{
|
||||
Title: "Message edited",
|
||||
Fields: fields,
|
||||
Color: 0xffff00,
|
||||
Image: image,
|
||||
},
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user