Compare commits

...

2 Commits

Author SHA1 Message Date
Lamp 20ecfb3e84 debug 2022-04-01 20:54:03 -07:00
Lamp 16f4b7eaf9 fix 2022-04-01 20:53:25 -07:00
1 changed files with 3 additions and 2 deletions

View File

@ -37,11 +37,12 @@ async function updateUserStatuses() {
let belowChannel = client.channels.resolve(config.vrchat_status_category).children.find(x => x.position = channel.position + 1); let belowChannel = client.channels.resolve(config.vrchat_status_category).children.find(x => x.position = channel.position + 1);
if (user.worldId && user.worldId != "offline") { if (user.worldId && user.worldId != "offline") {
console.debug(user.worldId);
let bcn = `${await getWorldNameForId(user.worldId)}`; let bcn = `${await getWorldNameForId(user.worldId)}`;
if (belowChannel && belowChannel.name.startsWith('┗') && belowChannel.name != bcn) { if (belowChannel && belowChannel.name.startsWith('┗') && belowChannel.name != bcn) {
await belowChannel.setName(bcn); await belowChannel.setName(bcn);
} else { } else {
let ch = await client.channels.resolve(config.vrchat_status_category).createChannel(`${worldname}`, {type: "GUILD_VOICE", position: belowChannel.position}); let ch = await client.channels.resolve(config.vrchat_status_category).createChannel(`${await getWorldNameForId(user.worldId)}`, {type: "GUILD_VOICE", position: belowChannel.position});
//position option doesn't work? //position option doesn't work?
await ch.setPosition(channel.position); await ch.setPosition(channel.position);
} }
@ -50,7 +51,7 @@ async function updateUserStatuses() {
} }
} catch (error) { } catch (error) {
console.error("vrcus", error.message); console.error("vrcus", error.stack);
} }
} }
} }