Gielert / NoodleJS

A NodeJS Mumble client
36 stars 14 forks source link

Make bot switch channel? #54

Open lolcatw opened 2 years ago

lolcatw commented 2 years ago

Hello! Is there a way currently to switch to another channel? Thank you!

lolcatw commented 2 years ago

To anyone reading this, this is how I fixed things on my end:

function switchChannel(id){

    // switch channel
    // i couldnt figure out how to use native switchChannel lol
    client.connection.writeProto(
        "UserState",
        {
            session: client.user.session,
            actor: client.user.session,
            channelId: id
        }
    );
}
Gielert commented 2 years ago

Hmm, there is a client.switchChannel function (see here) which accepts a channel id. Doesn't that work?

lolcatw commented 2 years ago

im getting "client.switchChannel is not a function." writeProto works on the exact same object!

as arguments, im simply giving it an ID to switch to!

Gielert commented 2 years ago

What version did you install? switchChannel has been implemented since 1.4.0

lolcatw commented 2 years ago

What version did you install? switchChannel has been implemented since 1.4.0

woops, i see that I'm using noodle.js@1.3.0! I see what's happening here. Since your package has a vulnerability, I went ahead and did npm audit fix --force, which downgraded noodle.js to 1.3.0!

Many thanks for your time, I will see if I can contribute later.