> For the complete documentation index, see [llms.txt](https://tdung.gitbook.io/zca-js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tdung.gitbook.io/zca-js/api/sendsticker.md).

# sendSticker

Gửi sticker/nhãn dán

## api.sendSticker(sticker, threadId\[, type])

### Parameters

* sticker `SendStickerPayload`
* threadId `string`
  * id của người/nhóm cần gửi
* type `ThreadType?`
  * loại thread: người dùng/nhóm, mặc định là người dùng

### Return

`Promise<SendStickerResponse>`

### Types

```typescript
export type SendStickerPayload = {
    id: number;
    cateId: number;
    type: number;
};

export type SendStickerResponse = {
    msgId: number;
};
```

### Examples

Gửi sticker `"xin chào"`

```typescript
import { ThreadType } from "zca-js"

// tìm sticker "hello", lấy và gửi sticker đầu tiên tìm thấy
api.getStickers("hello")
    .then(async (stickerIds) => {
        const stickersDetail = await api.getStickersDetail(stickerIds[0]);
        api.sendSticker(stickersDetail[0], "0000000000000001", ThreadType.User)
            .then(console.log)
            .catch(console.error);
    })
    .catch(console.error);
```

## Related

* [getStickers](/zca-js/api/getstickers.md)
* [getStickersDetail](/zca-js/api/getstickersdetail.md)
* [ThreadType](/zca-js/models/enum.md)
