• 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.

Bug Web interface not storing correct Channel-IDs (TS5 Beta Servers only?)

TwentyFour

BinusSot Junkie
V.I.P.
Contributor
Insider
Hey there,

I was just messing around and trying out some scripting on a test server (one of the free 10 slots ones of the TS beta).

Firstly I recognized the bot would not join any other channel besides the server's default one. The dropdown in the instance settings showed correct channel names, just selecting and saving didn't make the bot join the selected channel. But it stored that value (the channel name) nevertheless.
So I did not bother further.

Running my script later got me some undefined errors due to the backend not giving back a channel object.
Those was wierd, since on my other server the exact code runs fine:
JavaScript:
ChannelID = config.conf[i].OutputChannel;
backend.getChannelByID(ChannelId);

So rechecking the values, I ended up with the following values stored the webinteface:
#Example channel 1
config.conf[0].OutputChannel was set to 544625690941816800

#Example channel 2
config.conf[1].OutputChannel was set to 544625772053823500

Determining the "real" channel IDs via backend.getChannels() left me with these IDs:
#Example channel 1
544625690941816835

#Example channel 2
544625772053823490

So as you can see, they are almost the right ones. Just not exact on 18 digits, more rounded on 16 digits.
Is that just something that happens on those new servers due to increasing the length of those IDs and SinusBot not processing them properly, or has anyone encountered something similar so far? :rolleyes:
 

Multivitamin

Well-Known Member
Tier III
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
JavaScript by default starts rounding at some point
if you for example enter 100000000000000001 in your console then it will get rounded to a different number
best way to handle this case is to completely use it either as a string or handle it as a BigInt

do you have set in the config to use it as a "channel"?
 

TwentyFour

BinusSot Junkie
V.I.P.
Contributor
Insider
Yeah, the config values are set like this:
JavaScript:
name: 'OutputChannel',
indent: 1,
title: 'Channel:',
type: 'channel'

In the interface I can only select the channels directly from the tree, so I don't even come to the point, where I can possibly specify the handling as string or BigInt.

It even seems to fail to store the correct ID for the default channel in the interface, independent of any custom script.
 
Last edited:

flyth

is reticulating splines
Staff member
Developer
Contributor
This is actually a bigger issue than I thought, as the internal communication between plugin and bot uses JSON in some cases, which is limited in the same way as javascript is... Meh. :)

Thanks for reporting, though!
 

TwentyFour

BinusSot Junkie
V.I.P.
Contributor
Insider
Didn't report with the desire of a quick fix, just rather informative ;)
Thanks for having a look!

At the point where the beta servers are shut down again, prolly no normal server gets up to those high channel IDs... I also noticed some wierd behavior with channelParentID, which I discussed with @mxschmitt a little.
 
Top