still trying to get get-emoji to work

This commit is contained in:
2024-04-11 14:50:15 +02:00
parent bb9c616844
commit 0099e89294
7 changed files with 120 additions and 23 deletions

15
tool.go
View File

@@ -201,3 +201,18 @@ func isIDRole(c bot.Client, guildID snowflake.ID, id snowflake.ID) bool {
logrus.Error(err2)
return false
}
func isGIFImage(imageData []byte) bool {
if len(imageData) < 6 {
return false
}
// Check for the GIF89a header at the beginning of the byte array
if string(imageData[0:6]) == "GIF89a" {
return true
}
// Check for the GIF87a header at the beginning of the byte array
if string(imageData[0:6]) == "GIF87a" {
return true
}
return false
}