make webhook messages magenta

This commit is contained in:
Cynthia Foxwell 2023-07-14 21:15:40 -06:00
parent a9b3accdf6
commit 27ffa6ef14

View file

@ -21,6 +21,7 @@ type MessageOptions struct {
Name string Name string
Channel string Channel string
Bot bool Bot bool
Webhook bool
Attachments []*discordgo.MessageAttachment Attachments []*discordgo.MessageAttachment
Stickers []*discordgo.Sticker Stickers []*discordgo.Sticker
Reply *discordgo.Message Reply *discordgo.Message
@ -177,6 +178,8 @@ func FormatMessage(session *discordgo.Session, options MessageOptions) {
nameColor := "cyan+b" nameColor := "cyan+b"
if options.IsMention { if options.IsMention {
nameColor = "red+b" nameColor = "red+b"
} else if options.Webhook {
nameColor = "magenta+b"
} else if options.Bot { } else if options.Bot {
nameColor = "yellow+b" nameColor = "yellow+b"
} }
@ -293,6 +296,7 @@ func ProcessMessage(session *discordgo.Session, msg *discordgo.Message, options
options.Name = msg.Author.Username options.Name = msg.Author.Username
options.Channel = msg.ChannelID options.Channel = msg.ChannelID
options.Bot = msg.Author.Bot options.Bot = msg.Author.Bot
options.Webhook = msg.WebhookID != ""
options.Attachments = msg.Attachments options.Attachments = msg.Attachments
options.Stickers = msg.StickerItems options.Stickers = msg.StickerItems
if i == 0 { if i == 0 {
@ -311,6 +315,7 @@ func ProcessMessage(session *discordgo.Session, msg *discordgo.Message, options
options.Name = msg.Author.Username options.Name = msg.Author.Username
options.Channel = msg.ChannelID options.Channel = msg.ChannelID
options.Bot = msg.Author.Bot options.Bot = msg.Author.Bot
options.Webhook = msg.WebhookID != ""
options.Attachments = msg.Attachments options.Attachments = msg.Attachments
options.Stickers = msg.StickerItems options.Stickers = msg.StickerItems
options.Reply = msg.ReferencedMessage options.Reply = msg.ReferencedMessage