Closed liquidvisual closed 4 years ago
For a new sub its 'method' for resub it's 'methods' both follow the following format. I believe gift sub does as well. I did not find any documentation on these I just dropped my bot in a channel and logged them.
Edit: It is an object, the results are just from how I logged it.
var entries = Object.entries(method)
console.log(entries)
Prime Sub:
{ prime: true,
plan: 'Prime',
planName: 'Dr DisRespect' }
Tier 1:
{ prime: false,
plan: '1000',
planName: 'Dr DisRespect' }
Tier 2:
{ prime: false,
plan: '2000',
planName: 'Dr DisRespect' }
Tier 3:
{ prime: false,
plan: '3000',
planName: 'Dr DisRespect' }
(Editing to be objects instead of entries -Alca)
Thanks so much @Typ3Castt, you've saved me a lot of time! :) It's weird that they're an array of arrays, of course Twitch didn't want to make it easy for us.
It's not an array of arrays, it's an object.
https://github.com/tmijs/tmi.js/blob/92d7ccff8cecf33bc28c1f40612228e01943a4ff/lib/client.js#L651
Sorry, I should have been more clear. That is just how I logged them. It's an object.
var entries = Object.entries(method)
console.log(entries)`
The docs mention a 'method' object. What properties are in this object? Is this documented anywhere?
Cheers,