Compare commits

...

2 Commits

Author SHA1 Message Date
3369bd521d DEBUG BITCH 2022-04-01 22:09:07 -07:00
d52aff9936 ok 2022-04-01 22:03:00 -07:00

View File

@ -43,12 +43,14 @@ 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);
console.debug(channel.name, channel.position, belowChannel.name, belowChannel.position, belowChannel.id);
if (user.worldId && user.worldId != "offline") { if (user.worldId && user.worldId != "offline") {
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(`${await getWorldNameForId(user.worldId)}`, {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 is erratic
await ch.setPosition(channel.position + 1); await ch.setPosition(channel.position + 1);
} }
} else if (belowChannel?.name.startsWith('┗')) { } else if (belowChannel?.name.startsWith('┗')) {