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

Solved channelUpdate Event Bug

jonom

Member
I do not see why this bug is tagged as solved. I have the same issue and looking at all keys of the callback parameter I am quite sure this is only a channel object.
All keys of the callback: ["AddPermission","addPermission","Chat","chat","Codec","codec","CodecQuality","codecQuality","Delete","delete","Description","description","Equals","equals","GetClientCount","getClientCount","GetClients","getClients","GetMessages","getMessages","GetPermissions","getPermissions","GetURL","getURL","ID","iD","Id","id","IsDefault","isDefault","IsEncrypted","isEncrypted","IsPassworded","isPassworded","IsPermanent","isPermanent","IsSemiPermanent","isSemiPermanent","MarshalJSON","marshalJSON","MaxClients","maxClients","MaxFamilyClients","maxFamilyClients","MoveTo","moveTo","Name","name","Parent","parent","Position","position","SetChannelGroup","setChannelGroup","SetCodec","setCodec","SetCodecQuality","setCodecQuality","SetDefault","setDefault","SetDescription","setDescription","SetEncrypted","setEncrypted","SetMaxClients","setMaxClients","SetMaxFamilyClients","setMaxFamilyClients","SetName","setName","SetPassword","setPassword","SetPermanent","setPermanent","SetPosition","setPosition","SetSemiPermanent","setSemiPermanent","SetTopic","setTopic","String","string","Subscribe","subscribe","Topic","topic","Type","type","Update","update"]

EDIT: channelCreate and channelDelete seem to have the same problem
 

Relentless

Well-Known Member
Contributor
There are two parameters.
JavaScript:
event.on('channelUpdate', (channel, invoker) => { 
    // code
});
 
Last edited:

jonom

Member
I might be wrong here, but this was my test code:

JavaScript:
event.on("channelUpdate", (ev) => {
    let keys = [];
    for (var k in ev) keys.push(k);
    engine.log(keys);
})

IMO this should give me a channel and an invoker as keys. However, it returns the keys of the post above. Therefore, I think the full callback is simply a channel object.
 

Relentless

Well-Known Member
Contributor
That's right.
Which version of the bot are you using? This seems to be a bug indeed. So either the invoker object got removed from the event callback or the scripting documentation is wrong.
Can you show us the log when you use the following statement in your event?
JavaScript:
console.log(Object.entries(ev));
And yes, it's intended that it's using 'console.log'
 

jonom

Member
I am using version 1.0.0-beta.10-202ee4d. At least I think that is the version.

Code:
2020-10-07T22:17:38+02:00 [ bootstrap.js:1:949] [["AddPermission","function AddPermission() { [native code] } "],["addPermission","function addPermission() { [native code] } "],["Chat","function Chat() { [native code] } "],["chat","function chat() { [native code] } "],["Codec","function Codec() { [native code] } "],["codec","function codec() { [native code] } "],["CodecQuality","function CodecQuality() { [native code] } "],["codecQuality","function codecQuality() { [native code] } "],["Delete","function Delete() { [native code] } "],["delete","function delete() { [native code] } "],["Description","function Description() { [native code] } "],["description","function description() { [native code] } "],["Equals","function Equals() { [native code] } "],["equals","function equals() { [native code] } "],["GetClientCount","function GetClientCount() { [native code] } "],["getClientCount","function getClientCount() { [native code] } "],["GetClients","function GetClients() { [native code] } "],["getClients","function getClients() { [native code] } "],["GetMessages","function GetMessages() { [native code] } "],["getMessages","function getMessages() { [native code] } "],["GetPermissions","function GetPermissions() { [native code] } "],["getPermissions","function getPermissions() { [native code] } "],["GetURL","function GetURL() { [native code] } "],["getURL","function getURL() { [native code] } "],["ID","function ID() { [native code] } "],["iD","function iD() { [native code] } "],["Id","function Id() { [native code] } "],["id","function id() { [native code] } "],["IsDefault","function IsDefault() { [native code] } "],["isDefault","function isDefault() { [native code] } "],["IsEncrypted","function IsEncrypted() { [native code] } "],["isEncrypted","function isEncrypted() { [native code] } "],["IsPassworded","function IsPassworded() { [native code] } "],["isPassworded","function isPassworded() { [native code] } "],["IsPermanent","function IsPermanent() { [native code] } "],["isPermanent","function isPermanent() { [native code] } "],["IsSemiPermanent","function IsSemiPermanent() { [native code] } "],["isSemiPermanent","function isSemiPermanent() { [native code] } "],["MarshalJSON","function MarshalJSON() { [native code] } "],["marshalJSON","function marshalJSON() { [native code] } "],["MaxClients","function MaxClients() { [native code] } "],["maxClients","function maxClients() { [native code] } "],["MaxFamilyClients","function MaxFamilyClients() { [native code] } "],["maxFamilyClients","function maxFamilyClients() { [native code] } "],["MoveTo","function MoveTo() { [native code] } "],["moveTo","function moveTo() { [native code] } "],["Name","function Name() { [native code] } "],["name","function name() { [native code] } "],["Parent","function Parent() { [native code] } "],["parent","function parent() { [native code] } "],["Position","function Position() { [native code] } "],["position","function position() { [native code] } "],["SetChannelGroup","function SetChannelGroup() { [native code] } "],["setChannelGroup","function setChannelGroup() { [native code] } "],["SetCodec","function SetCodec() { [native code] } "],["setCodec","function setCodec() { [native code] } "],["SetCodecQuality","function SetCodecQuality() { [native code] } "],["setCodecQuality","function setCodecQuality() { [native code] } "],["SetDefault","function SetDefault() { [native code] } "],["setDefault","function setDefault() { [native code] } "],["SetDescription","function SetDescription() { [native code] } "],["setDescription","function setDescription() { [native code] } "],["SetEncrypted","function SetEncrypted() { [native code] } "],["setEncrypted","function setEncrypted() { [native code] } "],["SetMaxClients","function SetMaxClients() { [native code] } "],["setMaxClients","function setMaxClients() { [native code] } "],["SetMaxFamilyClients","function SetMaxFamilyClients() { [native code] } "],["setMaxFamilyClients","function setMaxFamilyClients() { [native code] } "],["SetName","function SetName() { [native code] } "],["setName","function setName() { [native code] } "],["SetPassword","function SetPassword() { [native code] } "],["setPassword","function setPassword() { [native code] } "],["SetPermanent","function SetPermanent() { [native code] } "],["setPermanent","function setPermanent() { [native code] } "],["SetPosition","function SetPosition() { [native code] } "],["setPosition","function setPosition() { [native code] } "],["SetSemiPermanent","function SetSemiPermanent() { [native code] } "],["setSemiPermanent","function setSemiPermanent() { [native code] } "],["SetTopic","function SetTopic() { [native code] } "],["setTopic","function setTopic() { [native code] } "],["String","function String() { [native code] } "],["string","function string() { [native code] } "],["Subscribe","function Subscribe() { [native code] } "],["subscribe","function subscribe() { [native code] } "],["Topic","function Topic() { [native code] } "],["topic","function topic() { [native code] } "],["Type","function Type() { [native code] } "],["type","function type() { [native code] } "],["Update","function Update() { [native code] } "],["update","function update() { [native code] } "]]

This was twice in the log, but I think this is due to the event being fired twice for some reason.
 
Top