# テンプレート『おみくじ』をスパチャのみで機能できたりしますでしょうか？

**URL:** <https://forum.onecomme.com/t/topic/1415>\
**Category:** 質問\
**Created:** [2023 年 11 月 9 日午後 1:23 UTC](https://forum.onecomme.com/t/topic/1415 "2023-11-09T13:23:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ASTIE](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.onecomme.com/astie/32/58_2.png) [@ASTIE](https://forum.onecomme.com/u/ASTIE)\
**Post date:** [2023 年 11 月 10 日午後 12:14 UTC](https://forum.onecomme.com/t/topic/1415/2 "2023-11-10T12:14:58Z")

</div>

こんばんわん  
Boothのおみくじのカスタマイズということなので全文を掲載できませんので部分のみとさせて頂きます

script.js79行目の部分を

```auto
if (comment.data.comment.includes(HIT_WORD)) {

```

次のコードに置き換えればおおよそ期待の動作になるかと思います

```auto
if (comment.data.hasGift && comment.data.giftType === 'superchat') {

```

こちらはコメントテスターでは確認できないため、実際にスパチャが送られている配信に接続して動作確認してみてください

この場合スーパーステッカーは含まれていませんので、もし含めたい場合は次に置き換えてください

```auto
if (comment.data.hasGift && (comment.data.giftType === 'superchat' || comment.data.giftType === 'supersticker')) {

```

giftTypeで取れるデータは次の通りになります

> **[GiftType | OneSDK](https://onecomme.com/sdk/types/types_YouTube.YouTube.GiftType)**
>
> Documentation for OneSDK

---

_[View the full topic](https://forum.onecomme.com/t/topic/1415)._
