> For the complete documentation index, see [llms.txt](https://tailieu.smax.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tailieu.smax.ai/extend-modules/gift-opening-game/ket-noi-chatbot.md).

# Kết nối chatbot

Để kết nối minigame mở quà với chatbot, đầu tiên bạn cần tạo 1 block trong module Bot-Auto, sau đó thêm 1 thẻ Messenger Text có button Chơi ngay vào trong block

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FLd9TFjCwkm4rTEM8nY1W%2Fimage%20(1).png?alt=media&amp;token=b87ee832-faba-4e67-81bd-41b0902a6f3a" alt=""><figcaption></figcaption></figure>

Trong phần cấu hình button, chọn Webview, sau đó chọn Lucky Wheel và chọn vòng quay bạn đã tạo trong module

Tạo thêm 1 block trong phần Gửi block khi nhận quà để gửi thông báo khi khách hàng quay xong, sau đó chọn kiểu hiển thị khi khách hàng mở game:

* New Tab: Mở game trong cửa sổ mới
* PopUp: Mở game trong cửa sổ Messenger

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FOVO04XL8daJYTayx2DFw%2Fimage%20(1).png?alt=media&amp;token=875eeefe-d305-43f5-a101-3ab52fc90ff3" alt=""><figcaption></figcaption></figure>

Trong block xác nhận sau khi khách hàng quay xong, bạn có thể sử dụng thẻ Messenger Text để gửi thông báo cho khách hàng, lưu ý sử dụng đúng thuộc tính lưu tên quà đã chọn trong phần Cấu hình thong báo

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FzyeQiuz1VaJav1RiMEJ3%2Fimage%20(1).png?alt=media&amp;token=95d68198-9d67-4745-90bc-5e26024bfa19" alt=""><figcaption></figcaption></figure>

Để thêm lượt chơi cho khách hàng, bạn có thể sử dụng thẻ Open Gift/ Add turn number phía trên thẻ Messenger Text có button Chơi game để thêm lượt chơi cho khách hàng, lưu ý chọn đúng game mở quà muốn thêm lượt và nhập số lượt muốn thêm cho khách hàng

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FBS3ncw5jK5gJ3J4oFUnB%2Fimage%20(1).png?alt=media&amp;token=2cf71836-8a3a-4dd3-95d0-2dd586d90114" alt=""><figcaption></figcaption></figure>
