Creating a !command that costs bits

Hey there, I’ve created a couple of simple custom commands that make a HTTP Request using something like

 var h = new HashMap(1);
 var r = HttpRequest.getData(HttpRequest.RequestType.GET, address+parameters, '', h); 

They send requests that toggle some local robots that do things like shoot vape fog at me and activate a bubble machine for a short while.

Currently they only cost bot currency but I’m looking for a way to trigger them from bits as well / instead to help monetize the stream. Is there some way I can do this in PhantomBot?

Would the only way to do it be to somehow check for the recent cheer amount and activate a bot based on the amount given? So like:
if(cheer == 420 bits){shoot vape fog at my face}
or something?

Not sure if there’s a more flexible system than relying on the user to donate the exact right amount… Any suggestions or help is appreciated!

something like this in a custom script

$.bind('twitchBits', function(event) {
    var username = event.getUsername(),
        bits = event.getBits();

    if(bits == 420) {
        $.say(shoot vape fog at my face);
    }
    return;
});

Thanks Dakoda!

Would that be the only reasonable way to charge bits for a command or is there any sort of panel or interactive UI that could communicate with PhantomBot that could process their cheer and trigger the bot to send the HTTP request?

If not, I’ll probably just use your suggested method

ya you would have to make a script to do it nothing like that built in

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.