sendSticker

Gửi sticker/nhãn dán

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

Parameters

  • sticker (Sticker): đối tượng sticker

  • threadId (string): id của người/nhóm cần gửi

  • type (MessageType): loại tin nhắn: gửi riêng/nhóm (mặc định là gửi riêng)

Return

Promise<SendStickerResponse>

Code mẫu

Gửi sticker "xin chào"

// 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], "0000000000000000", MessageType.DirectMessage)
            .then(console.log)
            .catch(console.error);
    })
    .catch(console.error);

Last updated