✨ Able to search sticker with alias
This commit is contained in:
@ -23,6 +23,7 @@ func MapAPIs(app *fiber.App, baseURL string) {
|
||||
api.Post("/attachments/multipart", createAttachmentMultipartPlaceholder)
|
||||
api.Post("/attachments/multipart/:file/:chunk", uploadAttachmentMultipart)
|
||||
|
||||
api.Get("/stickers/lookup", lookupStickerBatch)
|
||||
api.Get("/stickers/lookup/:alias", lookupSticker)
|
||||
api.Get("/stickers/manifest", listStickerManifest)
|
||||
api.Get("/stickers/packs", listStickerPacks)
|
||||
|
@ -12,6 +12,15 @@ import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func lookupStickerBatch(c *fiber.Ctx) error {
|
||||
probe := c.Query("probe")
|
||||
if stickers, err := services.GetStickerLikeAlias(probe); err != nil {
|
||||
return fiber.NewError(fiber.StatusNotFound, err.Error())
|
||||
} else {
|
||||
return c.JSON(stickers)
|
||||
}
|
||||
}
|
||||
|
||||
func lookupSticker(c *fiber.Ctx) error {
|
||||
alias := c.Params("alias")
|
||||
if sticker, err := services.GetStickerWithAlias(alias); err != nil {
|
||||
|
Reference in New Issue
Block a user