Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cardobj displays the wrong values when a message is added to the card #5

Open
BreeNET opened this issue Aug 8, 2023 · 1 comment
Open

Comments

@BreeNET
Copy link

BreeNET commented Aug 8, 2023

Shot in the dark, but any chance you can update this package? I'd paypal you tbh.
Theres an issue where when someone adds a message to a card, it misaligns the whole card object.

When I console.log my card object here is the response:

StreamlootsCard {
  imageURL: 'https://cdn.streamloots.com/uploads/admin-resources/b4766b5a-2252-4580-93fc-a519f61c4884.png',
  soundURL: 'https://static.streamloots.com/b352d1ef-d431-4c16-a48f-8bed0076403b/alerts/custom.mp3',
  message: 'twitch321 wants to listen to something',
  cardName: 'Play this',
  rarity: 'nocturnal rainbows by hopsin',
  userName: 'rare'
}

message is the alert message that plays on OBS when a card is played.
Rarity should say rare, but as you can see it says nocturnal rainbows by hopsin.
That field came from a message box where users can type in a message to include with their card.
Since that message field isnt accounted for, it bumps rarity and username down.

I'd make a pull request and fix it myself if I knew what I was doing.

The full HTTP body when a card is played:


data: {
    "imageUrl": "https://cdn.streamloots.com/uploads/admin-resources/43d46640-7e13-4504-85f8-9cbdd8fa9574.png",
    "soundUrl": "https://static.streamloots.com/b355d1ef-d931-4c16-a48f-8bed0599401b/alerts/default.mp3",
    "ttsBase64Audio": "SUQzBAAAAAAAI1RTU0UAAAAVVVVV",
    "message": "twitch321 wants you to play poilopoioipo or any other game",
    "settings": {
        "alertEffectConfiguration": {
            "soundBehaviour": "DEFAULT"
        },
        "duration": 3000,
        "sound": {
            "volume": 1
        },
        "text": {
            "color": "#fff",
            "fontWeight": 900,
            "fontSize": "60px",
            "fontFamily": "Roboto"
        },
        "textToSpeech": {
            "volume": 1
        }
    },
    "type": "alert",
    "data": {
        "badges": {},
        "cardId": "60c7681d232fcd003712f4d5",
        "cardSetId": "60c7680d232fcd805478f4a5",
        "cardName": "Let's play",
        "cardRarity": "EPIC",
        "description": "I have to play any kind of game.",
        "duration": 0,
        "fields": [
            {
                "name": "message",
                "value": "poilopoioipo"
            },
            {
                "name": "rarity",
                "value": "epic"
            },
            {
                "name": "username",
                "value": "twitch321"
            }
        ],
        "redeemFields": [
            {
                "required": true,
                "label": "What game would you suggest?",
                "name": "message",
                "type": "INPUT#TEXT",
                "value": "poilopoioipo"
            }
        ],
        "page": {
            "_id": "60c7672bbf21a9003519f452",
            "alertProviders": {
                "streamloots": {
                    "settings": {
                        "timer": {
                            "pageId": "60c7672bbf21a9003519b790",
                            "soundUrl": "https://static.streamloots.com/b406d1ef-d931-4c16-a48f-8bed00763f4b/timer/timer.mp3",
                            "delay": 4,
                            "verticalDirection": "topToBottom",
                            "textToShow": "cardDescription",
                            "showCardImage": true,
                            "showStreamlootsPage": true,
                            "timerSoundConfiguration": "default",
                            "volume": 0.7
                        }
                    }
                }
            },
            "slug": "twitch123"
        },
        "type": "redemption",
        "twitchChannelId": "twitch123"
    },
    "ack": {
        "correlationId": "147e484a-3ace-4a2e-baa8-947d52c0993d"
    }
}
@D4ddy-LiLd4rk
Copy link
Owner

Thanks for the heads up. I'll have a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants