ninbura
ninbura
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by ninbura on 8/27/2023 in #djs-questions
edit ephemeral message without access to interaction object
🙏
7 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/25/2023 in #djs-questions
Channel's position properties appear to be incoherent
I opened an issue on the djs github repo, hopefully I structured it well enough: https://github.com/discordjs/discord.js/issues/9668
19 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/25/2023 in #djs-questions
Channel's position properties appear to be incoherent
I believe it ultimately has something to do with the bot moving channels from one parent to another. I think somehow a channels position is remembered in a previous parent. It may be when the bot moves the channel from one parent to another, and then back again, which is what I'm doing. When the voice channel is "inactive" (no members connected) I use the bot to move it to "inactive channels". when the channel become active (1 or more members connected) again I move it back to "active voice".
19 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/25/2023 in #djs-questions
Channel's position properties appear to be incoherent
It's almost like a channel can remember a previous position on a previous parent... Look at this, if I use setParent() to move room-2 to active voice it relocates to the second position, but if I move room-3 it relocates the the bottom of the new parent. I can't seem to understand why they wouldn't both re-locate to the bottom of the category.
19 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/25/2023 in #djs-questions
Channel's position properties appear to be incoherent
Interestingly, I just deleted room-2 and recreated it and now when I use setParent() it relocates the channel to the bottom of the new parent instead of the top which is what it was doing previously.... maybe this was the problem 🤔 When you use setParent() do your channels relocated to the bottom or the top of the new parent?
19 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/25/2023 in #djs-questions
Channel's position properties appear to be incoherent
Did you catch the part where I said it only seems to be happening when I use the setParent() method? If I manually move a channel from one cateogry to another the positions are sane, but if I move a channel from one category to another with my bot the positional properties are not updating properly.
19 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/25/2023 in #djs-questions
Channel's position properties appear to be incoherent
The goal is to listen for the channelUpdate event, and re-sort channels when the channel's parent changes. But I first compare what I think the positions should be to what the positions are. In this case I think room-2 should be in position 1, but the cache's reporting that it's already in that position so I skip sorting them. If I bypass this check they sort into the proper positions, but I can't always bypass the check or the function would loop and spam the api. In the case of the code in the OP I'm logging this information in the ready event. And I've tried putting guild.channels.fetch() before I start grabbing room-1 & 2 to no avail. I also think that cache updates when the bot starts, so that should be redundant. Just a sanity check that the cache just is reporting improper positions. Whether that be djs' or the api's fault.
19 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/25/2023 in #djs-questions
Channel's position properties appear to be incoherent
No problem, I'll be surprised if anyone understands tbh. Feels like it must be a bug in djs or the api.
19 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/25/2023 in #djs-questions
Channel's position properties appear to be incoherent
const bot = new Client({
partials: [Partials.Channel, Partials.Message, Partials.Reaction],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.MessageContent,
],
})
const bot = new Client({
partials: [Partials.Channel, Partials.Message, Partials.Reaction],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.MessageContent,
],
})
19 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/25/2023 in #djs-questions
Channel's position properties appear to be incoherent
Just tried manually fetching channels for a guild in-hopes that that would update the cache and fix the issue, but that does nothing. Positional properties continue to report incorrect positions.
19 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/25/2023 in #djs-questions
Channel's position properties appear to be incoherent
I may be mistaken, but this appears to only be happening when I use the setParent() function on the channel. When someone joins room-1 I grab room-2 from an "inactive voice" category and move it to "active voice" so there's always an open room for people to join. When I use setParent() on room-2 to change its category, that's when it would appear that these positional properties report incorrect position. If I manually move the channel from one category to the other via Discord's GUI it looks like positional propteries are making more sense. Of course, this doesn't solve my problem, because I do want the bot to move the channel. I don't want to move them manually.
19 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/25/2023 in #djs-questions
Channel's position properties appear to be incoherent
19 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/23/2022 in #djs-questions
Manufacture PermissionOverwrites object
But honestly, maybe rather than messing with the cache I should just pass the button function a channel ID and change the color of the button regardless of what the cache says.
4 replies
DIAdiscord.js - Imagine an app
Created by ninbura on 6/23/2022 in #djs-questions
Manufacture PermissionOverwrites object
4 replies