• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

Upcoming changes for the scripting engine

Status
Not open for further replies.

flyth

is reticulating splines
Staff member
Developer
Contributor
Hi all,

I just wanted to announce shortly that there will be some changes to the scripting API in the next version that will affect almost all existing scripts somehow. I hope that it'll not be too tedious for people to adopt to, but I think that it’s better to take this step rather sooner than later.

The biggest change will be that all bot-relevant calls will now be part of a global „sinusbot“-object. This means that all calls like join() or say() now have to be called via sinusbot.join() and sinusbot.say(). It helps separating the internal javascript things from the bot specific stuff more, which leads to cleaner and better readable code.

Some calls also have been renamed to be more clear on what they actually do, like for example set() & get(). They have been renamed to sinusbot.setVar() and sinusbot.getVar() respectively.

So much for the main changes; now a little more about the new features:

While variables set with setVar() will only be available to the script itself (and not other scripts), new functions for global variables and instance-specific variables will be introduced with functions named setVarGlobal() and setVarInstance(). get- and unset-versions for that will of course also exist.

There will also be new events that can be triggered via the HTTP-API (and you can return data that way) and events to make it possible to communicate between instances (broadcast & unicast). More on that later and/or in examples.

A new minimal debug-console will help with testing your scripts from the web interface rather than via TS. It’s basically just a command-in result-out thing right now, but I think it’s pretty helpful already.

You will also be able to ship scripts with html-pages that will be served by the bot, making it more simple to deploy help pages or small interfaces. If you’re pretty familiar with the bot, you can even trigger the bots’ API from those pages.

The queue and playlists will be available via scripting as well as the internal search feature.

Last but not least there will be support for setTimeout / setInterval and their clear*-versions which I’m sure people have already waited for.

That’s it for now. If you want to test-drive sooner and have already released a script, feel free to send me a PM and I’ll add you to the „Insider“-Group. :)

Thanks for reading!
Michael aka Flyth
 

Roflmate

Member
Nice news, is there going to be an update where admins can set certain permissions for guests or disable registering on the bot?
 

flyth

is reticulating splines
Staff member
Developer
Contributor
Nice news, is there going to be an update where admins can set certain permissions for guests or disable registering on the bot?
Guest handling should be possible via "bind to group" - disabling registration is something that I will add sooner or later, yes.
 
Status
Not open for further replies.
Top