Utilizing the $(twitch) variable always returns [Invalid Method]

Hello Everyone,

I was reading and attempting to implement some commands utilizing the $(twitch) variable (https://docs.nightbot.tv/commands/variables/twitch) and it’s parameters but even when using the given examples (copied and pasted), Nightbot will always return “[Invalid Method]”. Is there a particular way that commands need to be written in addition to the examples?

Any help would be greatly appreciated.

Thanks,
Danoba.

Those docs are meant for Nightbot v4, so anything new, including the $(twitch) variable will not work with the current v3 version of Nightbot. You will have to wait until Nightbot v4 is released (which should be in public beta soon) to use it.

1 Like

Nightbot v3 variables are documented at http://wiki.nightbot.tv/chat:variables

Oh okay, well that makes far more sense that those variables would not be working. Thanks for the replies, they are greatly appreciated.

Is there a way that you can access channel information much like the $(twitch) variable to get information like a follower count or other useful information through the Nightbot API (or otherwise)? Much like how you could use “http://nightdev.com/hosted/followers.php” to get a limited list of the last set of followers. Is there any documentation on the Nightbot API or the hosted scripts? The wiki just says that the page will soon hold documentation for the new Nightbot API.

I know there is a post with custom APIs already (Useful Custom APIs) that can accomplish this but I wouldn’t mind learning how it works and how I can access said information much like those given APIs so that I could write my own custom commands and responses.

Thanks.

With the current version of Nightbot you can’t get user information like that without using the $(customapi) variable, so for now you’d have to use those Custom APIs listed on that post, but again Nightbot v4 should be in public beta soon!

Oh okay, thanks, much appreciated. Is there a place besides the wiki that lists more information about the $(customapi) variable and some of the already available API calls? The wiki only has one or two examples.

I did look at http://dev.twitch.tv/ but it would appear to be a little overly complex for what I would like to do at this time. Perhaps waiting for the public beta for v4 of Nightbot might be the best solution.

If you’re looking for some APIs you can use with the variable, then the best place is going to be that post you linked earlier: Useful Custom APIs As far as exmaple usage, it’s fairly simple: $(customapi url_here). So for total amount of followers you can use $(customapi https://api.rtainc.co/twitch/followers/count?channel=CHANNEL) and depending on what the API you’re using returns you can customize the message.

Hope this helps!

1 Like

Oh okay, I was thinking there may have been additional scripts available that were built by the Nightdev team much like the uptime and last follower scripts. I’ll make use of the custom APIs built by rtainc though until v4 of Nightbot is released into public beta. Appreciate the help!

Do you know offhand if v4 of Nightbot is going to allow $(alias) to call custom commends? I know at the moment it will only allow the calling of current commands built into Nightbot.

I’m not entirely sure… as far as I know all the variables for v4 have already been documented on the docs site under Variables, so either its not going to be added or it will be added sometime after launch.

Perhaps @night can chime in with a more definite answer.

Oh okay, right, just realized it was omitted. Hopefully there are plans for it because it’s very handy.

Thanks for being such a great help, I really appreciate it.

1 Like

While we are planning to add more extensibility to the Twitch variable in Nightbot v4, our focus at launch is stability, not features. Down the road we’re looking to gain feedback from users to then focus on what people want the most in terms of features.

2 Likes

That sounds great, I’m hoping I will be able to contribute and help with that when the time comes. Nightbot really is an excellent bot/tool, so I’m definitely looking forward to being able to access the new version when it becomes available.

Thanks for responding, it is greatly appreciated.

1 Like

We’ve launched aliases for commands.

You can check out the docs for information: https://docs.nightbot.tv/control-panel/commands
I posted an example as well: Can commands interact with each other and, if so, how?

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