👔 Sticker creation & edit will no longer check metadta
This commit is contained in:
parent
8b3a7d6324
commit
4c5d6d5ec5
@ -86,12 +86,6 @@ func createSticker(c *fiber.Ctx) error {
|
|||||||
|
|
||||||
if strings.SplitN(attachment.MimeType, "/", 2)[0] != "image" {
|
if strings.SplitN(attachment.MimeType, "/", 2)[0] != "image" {
|
||||||
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must be an image")
|
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must be an image")
|
||||||
} else if width, ok := attachment.Metadata["width"]; !ok {
|
|
||||||
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must has width metadata")
|
|
||||||
} else if height, ok := attachment.Metadata["height"]; !ok {
|
|
||||||
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must has height metadata")
|
|
||||||
} else if fmt.Sprint(width) != fmt.Sprint(28) || fmt.Sprint(height) != fmt.Sprint(28) {
|
|
||||||
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must be a 28x28 image")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var pack models.StickerPack
|
var pack models.StickerPack
|
||||||
@ -146,12 +140,6 @@ func updateSticker(c *fiber.Ctx) error {
|
|||||||
|
|
||||||
if strings.SplitN(attachment.MimeType, "/", 2)[0] != "image" {
|
if strings.SplitN(attachment.MimeType, "/", 2)[0] != "image" {
|
||||||
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must be an image")
|
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must be an image")
|
||||||
} else if width, ok := attachment.Metadata["width"]; !ok {
|
|
||||||
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must has width metadata")
|
|
||||||
} else if height, ok := attachment.Metadata["height"]; !ok {
|
|
||||||
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must has height metadata")
|
|
||||||
} else if fmt.Sprint(width) != fmt.Sprint(28) || fmt.Sprint(height) != fmt.Sprint(28) {
|
|
||||||
return fiber.NewError(fiber.StatusBadRequest, "sticker attachment must be a 28x28 image")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var pack models.StickerPack
|
var pack models.StickerPack
|
||||||
|
Loading…
Reference in New Issue
Block a user