• TeamSpeak has reported a vulnerability in it's client that can potentially lead to RCE. A new version has been released that fixes it. So please update the client in your bot installation as soon as possible as well. Click here for more information.
  • If you need help or want to discuss things, you now can also join us on our Discord Server!

Nicht erwartete Rückgabe von Channel.position

Kamikaze

Donor
is awesome!
Contributor
Die Funktion Channel.position() gibt nicht die position des Channels aus.
Komme auch leider nicht dahinter nach welcher Logik die Position ermittelt wird.

Nutze Die Win64 Sinusbot Version: 1.0.0-alpha.5-9767656

JavaScript:
        function renameChannels(i) {
            var currentLobby = config.lobbyListener[i];
            var Channels = backend.getChannels();
            Channels.forEach(function(ch) {
                var parentChannel = ch.parent();
                if (parentChannel !== undefined) {
                    if (parentChannel.id() == currentLobby.channel) {
                        console.log("Channel: " ch.name())
                        console.log("ch.position: " + ch.position())
                        console.log("ch.id(): " + ch.id())
                        console.log("---")
                    }
                }
            });
        }
Log:
Code:
2019-06-10T10:26:25+02:00 [ bootstrap.js:1:949] ---
2019-06-10T10:26:25+02:00 [ bootstrap.js:1:949] ch.id(): 201
2019-06-10T10:26:25+02:00 [ bootstrap.js:1:949] ch.position: 199
2019-06-10T10:26:25+02:00 [ bootstrap.js:1:949] ch.name(): Second Channel
2019-06-10T10:26:25+02:00 [ bootstrap.js:1:949] ---
2019-06-10T10:26:25+02:00 [ bootstrap.js:1:949] ch.id(): 199
2019-06-10T10:26:25+02:00 [ bootstrap.js:1:949] ch.position: 0
2019-06-10T10:26:25+02:00 [ bootstrap.js:1:949] ch.name(): First Channel
2019-06-10T10:26:25+02:00 [ bootstrap.js:1:949] ---
2019-06-10T10:26:25+02:00 [ bootstrap.js:1:949] ch.id(): 200
2019-06-10T10:26:25+02:00 [ bootstrap.js:1:949] ch.position: 201
2019-06-10T10:26:25+02:00 [ bootstrap.js:1:949] ch.name(): Thrid Channel
EDIT:

First Channel
ch.id(): 199
ch.position: 0

Second Channel
ch.id(): 201
ch.position: 199

Third Channel
ch.id(): 200
ch.position: 201

Sieht so aus als würde sich die position immer auf die ChannelID des vorherigen Channels beziehen. Wodurch 0 dann der übergeordnete Channel ist.
 
Last edited:

Similar threads

Top