NoodleJS icon indicating copy to clipboard operation
NoodleJS copied to clipboard

Make bot switch channel?

Open lolcatw opened this issue 2 years ago • 5 comments

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

lolcatw avatar Sep 02 '22 01:09 lolcatw

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
		}
	);
}

lolcatw avatar Sep 02 '22 06:09 lolcatw

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

Gielert avatar Sep 02 '22 07:09 Gielert

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!

lolcatw avatar Sep 02 '22 08:09 lolcatw

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

Gielert avatar Sep 02 '22 08:09 Gielert

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

woops, i see that I'm using [email protected]! 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.

lolcatw avatar Sep 02 '22 08:09 lolcatw