Show channel + author mention for removed messages

This commit is contained in:
2022-08-11 07:41:30 -04:00
parent f5c59af2b4
commit 5ae7a96c3e

View File

@ -64,7 +64,12 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
if !safe {
s.ChannelMessageSend(m.ChannelID, "That domain is not approved by the admins. Please contact Admins if the domain should be whitelisted.")
s.ChannelMessageDelete(m.ChannelID, m.ID)
s.ChannelMessageSend(config.AdminChannel, fmt.Sprintf("DELETED [%+v]: %+v", m.Author.Username, m.Content))
channel, err := s.Channel(m.ChannelID)
if err != nil {
s.ChannelMessageSend(config.AdminChannel, fmt.Sprintf("DELETED %+v [%+v]: %+v", m.Author.Mention(), m.ChannelID, m.Content))
} else {
s.ChannelMessageSend(config.AdminChannel, fmt.Sprintf("DELETED %+v [%+v]: %+v", m.Author.Mention(), channel.Name, m.Content))
}
}
}
parts := strings.Split(m.Content, " ")