Only accept certain formats.
This commit is contained in:
@ -109,6 +109,18 @@ func handlePM(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|||||||
s.ChannelMessageSend(m.ChannelID, "You have tried to send an unsupported file (HEIC). Please try again using an image (jpeg, jpg, png, etc).")
|
s.ChannelMessageSend(m.ChannelID, "You have tried to send an unsupported file (HEIC). Please try again using an image (jpeg, jpg, png, etc).")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if strings.HasSuffix(strings.ToUpper(m.Attachments[0].ProxyURL), "MP4") {
|
||||||
|
s.ChannelMessageSend(m.ChannelID, "You have tried to send an unsupported file (MP4 Video). Please try again using an image (jpeg, jpg, png, etc).")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if strings.HasSuffix(strings.ToUpper(m.Attachments[0].ProxyURL), "MP3") {
|
||||||
|
s.ChannelMessageSend(m.ChannelID, "You have tried to send an unsupported file (MP3 Audio). Please try again using an image (jpeg, jpg, png, etc).")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !strings.HasSuffix(strings.ToUpper(m.Attachments[0].ProxyURL), "JPG") || !strings.HasSuffix(strings.ToUpper(m.Attachments[0].ProxyURL), "JPEG") || !strings.HasSuffix(strings.ToUpper(m.Attachments[0].ProxyURL), "PNG") || !strings.HasSuffix(strings.ToUpper(m.Attachments[0].ProxyURL), "BMP") {
|
||||||
|
s.ChannelMessageSend(config.AdminChannel, "You have tried to send an unsupported file. Please try again using an image (jpeg, jpg, png, etc).")
|
||||||
|
//return
|
||||||
|
}
|
||||||
delete(config.Unverified, m.Author.ID)
|
delete(config.Unverified, m.Author.ID)
|
||||||
var v Verification
|
var v Verification
|
||||||
v.Submitted = time.Now()
|
v.Submitted = time.Now()
|
||||||
|
|||||||
Reference in New Issue
Block a user