doqe
doqe
Explore posts from servers
SIASapphire - Imagine a framework
Created by doqe on 7/17/2024 in #sapphire-support
how would i know if a certain precondition is in a command?
i didnt rly find any function/feature for checking for a precondition
const fields = commands.map((v) => {
const prefix = v.supportsMessageCommands() == v.supportsChatInputCommands() ? "" : (v.supportsMessageCommands() ? "!" : "/")
const preconditionTag = v.preconditions.entries.includes("OwnerOnly" as any) ? `(OWNER ONLY)` : "" // this always returns false (i tested it)

return {name: `${prefix}${v.name} ${preconditionTag}`, value: `${v.description}`}
})
const fields = commands.map((v) => {
const prefix = v.supportsMessageCommands() == v.supportsChatInputCommands() ? "" : (v.supportsMessageCommands() ? "!" : "/")
const preconditionTag = v.preconditions.entries.includes("OwnerOnly" as any) ? `(OWNER ONLY)` : "" // this always returns false (i tested it)

return {name: `${prefix}${v.name} ${preconditionTag}`, value: `${v.description}`}
})
5 replies
SIASapphire - Imagine a framework
Created by doqe on 4/8/2024 in #sapphire-support
create a command that has spaces as one arg
for example, i would want a command with multiple spaces for each arg, such as !command <argwithspaces1> <argwithspaces2>, or even using seperators like | i just dont know where to start or if its even possible at all ( i tried using args.repeat and args.nextMaybe but that didnt work at all )
14 replies
SIASapphire - Imagine a framework
Created by doqe on 2/25/2024 in #sapphire-support
making a !help command. where do i get the commands from?
im trying to make a help command since I've started learning about paginated messages, but where would I get these commands from?
4 replies
SIASapphire - Imagine a framework
Created by doqe on 1/20/2024 in #sapphire-support
Would there be a way to make a command list?
How would I make a command list, for example you would use !help (or !help <commandName>) (example message)
Commands !help - Gets all the commands (the one you just used) !commandName - Command Description !otherCommand - Other Description
7 replies
SIASapphire - Imagine a framework
Created by doqe on 1/3/2024 in #sapphire-support
[ARGS] this.error errors in the console
No description
4 replies
SIASapphire - Imagine a framework
Created by doqe on 1/3/2024 in #sapphire-support
Class constructor _Listener cannot be invoked without 'new'
i just got the listener from the docs and now it's sending this warning
Error when loading 'D:\Gits\dqm-neo\src\listeners\ready.ts': TypeError: Class constructor _Listener cannot be invoked without 'new'
at new ReadyListener (D:\Gits\dqm-neo\src\listeners\ready.ts:23:42)
at _ListenerStore.construct (D:\Gits\dqm-neo\node_modules\@sapphire\pieces\src\lib\structures\Store.ts:337:2)
at _ListenerStore.loadPath (D:\Gits\dqm-neo\node_modules\@sapphire\pieces\src\lib\structures\Store.ts:366:5)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async _ListenerStore.loadAll (D:\Gits\dqm-neo\node_modules\@sapphire\pieces\src\lib\structures\Store.ts:257:17)
at async Promise.all (index 3)
at async _SapphireClient.login (D:\Gits\dqm-neo\node_modules\@sapphire\framework\src\lib\SapphireClient.ts:352:3)
Error when loading 'D:\Gits\dqm-neo\src\listeners\ready.ts': TypeError: Class constructor _Listener cannot be invoked without 'new'
at new ReadyListener (D:\Gits\dqm-neo\src\listeners\ready.ts:23:42)
at _ListenerStore.construct (D:\Gits\dqm-neo\node_modules\@sapphire\pieces\src\lib\structures\Store.ts:337:2)
at _ListenerStore.loadPath (D:\Gits\dqm-neo\node_modules\@sapphire\pieces\src\lib\structures\Store.ts:366:5)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async _ListenerStore.loadAll (D:\Gits\dqm-neo\node_modules\@sapphire\pieces\src\lib\structures\Store.ts:257:17)
at async Promise.all (index 3)
at async _SapphireClient.login (D:\Gits\dqm-neo\node_modules\@sapphire\framework\src\lib\SapphireClient.ts:352:3)
11 replies
DIdiscord.js - Imagine ❄
Created by doqe on 12/3/2023 in #djs-questions
Channel is not in cache when button interaction is used.
I tried making a button that would delete the message when clicked, but this error showed up: The Error
uncaughtException: Error [ChannelNotCached]: Could not find the channel where this message came from in the cache!
at Message.delete (D:\Gits\dqm\backend-next\node_modules\discord.js\src\structures\Message.js:828:30)
at NewCli.<anonymous> (D:\Gits\dqm\backend-next\src\server\client.ts:33:39)
at NewCli.emit (node:events:514:28)
at NewCli.emit (node:domain:488:12)
at InteractionCreateAction.handle (D:\Gits\dqm\backend-next\node_modules\discord.js\src\client\actions\InteractionCreate.js:97:12)
at Object.module.exports [as INTERACTION_CREATE] (D:\Gits\dqm\backend-next\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (D:\Gits\dqm\backend-next\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (D:\Gits\dqm\backend-next\node_modules\discord.js\src\client\websocket\WebSocketManager.js:239:12)
at WebSocketManager.emit (D:\Gits\dqm\backend-next\node_modules\@vladfrangu\async_event_emitter\src\index.ts:356:28)
at WebSocketShard.<anonymous> (D:\Gits\dqm\backend-next\node_modules\@discordjs\ws\src\strategies\sharding\SimpleShardingStrategy.ts:32:47)
at WebSocketShard.emit (D:\Gits\dqm\backend-next\node_modules\@vladfrangu\async_event_emitter\src\index.ts:356:28)
at WebSocketShard.onMessage (D:\Gits\dqm\backend-next\node_modules\@discordjs\ws\src\ws\WebSocketShard.ts:630:10)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ChannelNotCached'
}
uncaughtException: Error [ChannelNotCached]: Could not find the channel where this message came from in the cache!
at Message.delete (D:\Gits\dqm\backend-next\node_modules\discord.js\src\structures\Message.js:828:30)
at NewCli.<anonymous> (D:\Gits\dqm\backend-next\src\server\client.ts:33:39)
at NewCli.emit (node:events:514:28)
at NewCli.emit (node:domain:488:12)
at InteractionCreateAction.handle (D:\Gits\dqm\backend-next\node_modules\discord.js\src\client\actions\InteractionCreate.js:97:12)
at Object.module.exports [as INTERACTION_CREATE] (D:\Gits\dqm\backend-next\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (D:\Gits\dqm\backend-next\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (D:\Gits\dqm\backend-next\node_modules\discord.js\src\client\websocket\WebSocketManager.js:239:12)
at WebSocketManager.emit (D:\Gits\dqm\backend-next\node_modules\@vladfrangu\async_event_emitter\src\index.ts:356:28)
at WebSocketShard.<anonymous> (D:\Gits\dqm\backend-next\node_modules\@discordjs\ws\src\strategies\sharding\SimpleShardingStrategy.ts:32:47)
at WebSocketShard.emit (D:\Gits\dqm\backend-next\node_modules\@vladfrangu\async_event_emitter\src\index.ts:356:28)
at WebSocketShard.onMessage (D:\Gits\dqm\backend-next\node_modules\@discordjs\ws\src\ws\WebSocketShard.ts:630:10)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ChannelNotCached'
}
The Code
// interaction code

if (inter.customId == "selfdestruct") {
await inter.message.delete()
}

// message code

const cancel = new ButtonBuilder()
.setCustomId(`selfdestruct`)
.setLabel('Cancel')
.setStyle(ButtonStyle.Secondary)

const row = new ActionRowBuilder<ButtonBuilder>()
.addComponents(confirm, cancel)


inter.reply({ embeds: [embed], components: [row] })
// interaction code

if (inter.customId == "selfdestruct") {
await inter.message.delete()
}

// message code

const cancel = new ButtonBuilder()
.setCustomId(`selfdestruct`)
.setLabel('Cancel')
.setStyle(ButtonStyle.Secondary)

const row = new ActionRowBuilder<ButtonBuilder>()
.addComponents(confirm, cancel)


inter.reply({ embeds: [embed], components: [row] })
The Version
node 20.8.0
d.js 14.14.1
node 20.8.0
d.js 14.14.1
7 replies
DIdiscord.js - Imagine ❄
Created by doqe on 8/2/2023 in #djs-questions
[TS] message member is possibly null
12 replies
DIdiscord.js - Imagine ❄
Created by doqe on 8/1/2023 in #djs-questions
[TS] how come .send doesn't exist?
client.guilds.cache.get('asdsda')?.channels.cache.get('asd')?.send()
client.guilds.cache.get('asdsda')?.channels.cache.get('asd')?.send()
dont mind that the string fields are asdsda, the only error im getting as of now is that channel.send does not exist at all npm v.9.6.7 node v.18.3.0 discord.js v14.11.0
5 replies
DIdiscord.js - Imagine ❄
Created by doqe on 7/29/2023 in #djs-questions
[TS] Argument of type 'GuildMember | APIInteractionGuildMember | null'
10 replies
DIdiscord.js - Imagine ❄
Created by doqe on 7/29/2023 in #djs-questions
Property 'cmds' does not exist on type 'Client<boolean>'
9 replies
DIdiscord.js - Imagine ❄
Created by doqe on 6/9/2023 in #djs-questions
Cannot Edit Interaction
6 replies
DIdiscord.js - Imagine ❄
Created by doqe on 6/9/2023 in #djs-questions
opt is not defined
7 replies
DIdiscord.js - Imagine ❄
Created by doqe on 12/23/2022 in #djs-questions
2FA is required, but I don't know how?
16 replies
DIdiscord.js - Imagine ❄
Created by doqe on 8/13/2022 in #djs-questions
Intents
I plan to give my bot all intents (32767), How do I do that because I used to use
const bot = new Discord.Client({intents: new Discord.Intents(32767)})
const bot = new Discord.Client({intents: new Discord.Intents(32767)})
4 replies
DIdiscord.js - Imagine ❄
Created by doqe on 7/8/2022 in #djs-questions
Slash Commands
Is there any easy way of adding slash commands to my bot? (I already got a normal command parser but I don't wanna go through making /help commands and I'm pretty interested in modals.)
13 replies