instafluff / ComfyJS

Comfiest Twitch Chat Library for JavaScript | NodeJS + Browser Support
MIT License
405 stars 44 forks source link

Unhandled error when trying to create a custom reward #27

Closed Batista-Gabriel closed 2 years ago

Batista-Gabriel commented 3 years ago

When i tried to create a custom reward that already existed, it sais

UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined
    at Object.CreateChannelReward (..\node_modules\comfy.js\app.js:648:29)

looking at that file, i think that if the code below were used after line 646, it could help understanding the cause.

if(custom.message == "CREATE_CUSTOM_REWARD_DUPLICATE_REWARD"){
 throw new Error( "Duplicated Custom Reward" ) 
}
return custom.data[ 0 ];
SinisterMaya commented 3 years ago

had a similar issue. To me, reason was that I capped my channel custom reward. you may only have 50.

Batista-Gabriel commented 3 years ago

Actually i found out there are many of those unhandled errors, but I won't keep complaining. I really appreciate what those guys made so far. Thanks, instafluff and friends!