Hmm.. I modified your code so I could run it: on('ready',()=>{
on('chat:message',(msg)=>{
if('api'===msg.type && /^!skepickle/i.test(msg.content) && playerIsGM(msg.playerid)) {
log("debug-selected");
for (let selected of msg.selected) {
log("######");
log(selected)
let o = getObj(selected["_type"],selected["_id"]);
log(o);
};
}
});
});
and got these results: "debug-selected"
"######"
{"_id":"-LGDM-Hrclu7jsJS0T8Y","_type":"text"}
{"top":169.99999999999997,"left":1287.3017578125,"width":149.087890625,"height":51.2,"text":"This is a test","font_size":32,"rotation":0,"color":"rgb(255, 153, 0)","font_family":"Patrick Hand","controlledby":"-JS3qKxIUPHLzSbK24ve","layer":"objects","_id":"-LGDM-Hrclu7jsJS0T8Y","_pageid":"-Jov_sJgYwFupeSJoIXF","_type":"text"}
"######"
{"_id":"-LGDM7sVcUX7MpEt8S6q","_type":"text"}
{"top":240,"left":1290.8203125,"width":156.125,"height":51.2,"text":"This is a test","font_size":32,"rotation":0,"color":"rgb(255, 153, 0)","font_family":"Contrail One","controlledby":"-JS3qKxIUPHLzSbK24ve","layer":"objects","_id":"-LGDM7sVcUX7MpEt8S6q","_pageid":"-Jov_sJgYwFupeSJoIXF","_type":"text"}
"######"
{"_id":"-LGDM81EkGyvkAhZ4tNZ","_type":"text"}
{"top":310,"left":1295.0390625,"width":164.5625,"height":51.2,"text":"This is a test","font_size":32,"rotation":0,"color":"rgb(255, 153, 0)","font_family":"Shadows Into Light","controlledby":"-JS3qKxIUPHLzSbK24ve","layer":"objects","_id":"-LGDM81EkGyvkAhZ4tNZ","_pageid":"-Jov_sJgYwFupeSJoIXF","_type":"text"}
"######"
{"_id":"-LGDM8AX0CIaiTGt3bu9","_type":"text"}
{"top":380,"left":1326,"width":226.484375,"height":51.2,"text":"This is a test","font_size":32,"rotation":0,"color":"rgb(255, 153, 0)","font_family":"Candal","controlledby":"-JS3qKxIUPHLzSbK24ve","layer":"objects","_id":"-LGDM8AX0CIaiTGt3bu9","_pageid":"-Jov_sJgYwFupeSJoIXF","_type":"text"}
"######"
{"_id":"-LGDM8TBMC2zFs30yXxY","_type":"text"}
{"top":100,"left":1302.5625,"width":179.609375,"height":51.2,"text":"This is a test","font_size":32,"rotation":0,"color":"rgb(255, 153, 0)","font_family":"Arial","controlledby":"-JS3qKxIUPHLzSbK24ve","layer":"objects","_id":"-LGDM8TBMC2zFs30yXxY","_pageid":"-Jov_sJgYwFupeSJoIXF","_type":"text"} I'd say if you disable all scripts, put my version in as the only active one and run !skepickle and you still get undefined, then you can say with certainty that something in your game is borked. If my version in those conditions works, then there is some other API script that is breaking things.