Akanixon
Akanixon
SIASapphire - Imagine a framework
Created by Akanixon on 3/30/2023 in #sapphire-support
TypeError: channel.isTextBased is not a function
I have a problem with Interactions: Since yesterday evening every button interaction results in an error as follows
/home/developer/Wishbot/node_modules/discord.js/src/client/actions/InteractionCreate.js:50
if (channel && !channel.isTextBased()) return;
^

TypeError: channel.isTextBased is not a function
at InteractionCreateAction.handle (/home/developer/Wishbot/node_modules/discord.js/src/client/actions/InteractionCreate.js:50:33)
at module.exports [as INTERACTION_CREATE] (/home/developer/Wishbot/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/home/developer/Wishbot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:352:31)
at WebSocketShard.onPacket (/home/developer/Wishbot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:489:22)
at WebSocketShard.onMessage (/home/developer/Wishbot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:328:10)
at callListener (/home/developer/Wishbot/node_modules/ws/lib/event-target.js:290:14)
at WebSocket.onMessage (/home/developer/Wishbot/node_modules/ws/lib/event-target.js:209:9)
at WebSocket.emit (node:events:512:28)
at Receiver.receiverOnMessage (/home/developer/Wishbot/node_modules/ws/lib/websocket.js:1180:20)
at Receiver.emit (node:events:512:28)
/home/developer/Wishbot/node_modules/discord.js/src/client/actions/InteractionCreate.js:50
if (channel && !channel.isTextBased()) return;
^

TypeError: channel.isTextBased is not a function
at InteractionCreateAction.handle (/home/developer/Wishbot/node_modules/discord.js/src/client/actions/InteractionCreate.js:50:33)
at module.exports [as INTERACTION_CREATE] (/home/developer/Wishbot/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/home/developer/Wishbot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:352:31)
at WebSocketShard.onPacket (/home/developer/Wishbot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:489:22)
at WebSocketShard.onMessage (/home/developer/Wishbot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:328:10)
at callListener (/home/developer/Wishbot/node_modules/ws/lib/event-target.js:290:14)
at WebSocket.onMessage (/home/developer/Wishbot/node_modules/ws/lib/event-target.js:209:9)
at WebSocket.emit (node:events:512:28)
at Receiver.receiverOnMessage (/home/developer/Wishbot/node_modules/ws/lib/websocket.js:1180:20)
at Receiver.emit (node:events:512:28)
6 replies
SIASapphire - Imagine a framework
Created by Akanixon on 3/20/2023 in #sapphire-support
Message editing fails even though message can be fetched
Whenever I want to edit an ephemeral message I get the following error:
[ERROR] Encountered error while handling an interaction handler run method for interaction-handler "release_card" at path "/home/developer/Wishbot/src/interaction-handlers/release_card.js" DiscordAPIError[10008]: Unknown Message
[ERROR] Encountered error while handling an interaction handler run method for interaction-handler "release_card" at path "/home/developer/Wishbot/src/interaction-handlers/release_card.js" DiscordAPIError[10008]: Unknown Message
The message can be correctly fetched though using the channel and message id
let msg = await channel.messages.fetch(interaction.message.id);
console.log(msg); //<= Shows the correct message object
return await msg.edit({embeds: [msg.embeds],components:[]}); //<= breaks because this message is Unknown
let msg = await channel.messages.fetch(interaction.message.id);
console.log(msg); //<= Shows the correct message object
return await msg.edit({embeds: [msg.embeds],components:[]}); //<= breaks because this message is Unknown
5 replies
SIASapphire - Imagine a framework
Created by Akanixon on 1/26/2023 in #sapphire-support
A compatible class export was not found.
When use HMR and edit files It always sends an error, no matter what file is being edited:
9|Wishbot | [ERROR] [HMR-Plugin]: Failed to load pieces from /root/node/Customers/Wishbot/src/commands/collection.js. Error [EMPTY_MODULE]: A compatible class export was not found. [/root/node/Customers/Wishbot/src/commands/collection.js]
9|Wishbot | at LoaderStrategy.load (/root/node/Customers/Wishbot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js:92:19)
9|Wishbot | at async CommandStore.load (/root/node/Customers/Wishbot/node_modules/@sapphire/pieces/dist/lib/structures/Store.js:89:26)
9|Wishbot | at async SlashCommand.reload (/root/node/Customers/Wishbot/node_modules/@sapphire/pieces/dist/lib/structures/Piece.js:94:9)
9|Wishbot | at async SlashCommand.reload (/root/node/Customers/Wishbot/node_modules/@sapphire/framework/dist/lib/structures/Command.js:108:5)
9|Wishbot | at async /root/node/Customers/Wishbot/node_modules/@sapphire/plugin-hmr/dist/lib/hmr.js:49:13
9|Wishbot | at async Object.fromAsync (/root/node/Customers/Wishbot/node_modules/@sapphire/result/dist/index.js:615:22)
9|Wishbot | at async handlePiecePathUpdate (/root/node/Customers/Wishbot/node_modules/@sapphire/plugin-hmr/dist/lib/hmr.js:47:20) {
9|Wishbot | type: 'EMPTY_MODULE',
9|Wishbot | path: '/root/node/Customers/Wishbot/src/commands/collection.js'
9|Wishbot | }
9|Wishbot | [ERROR] [HMR-Plugin]: Failed to load pieces from /root/node/Customers/Wishbot/src/commands/collection.js. Error [EMPTY_MODULE]: A compatible class export was not found. [/root/node/Customers/Wishbot/src/commands/collection.js]
9|Wishbot | at LoaderStrategy.load (/root/node/Customers/Wishbot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js:92:19)
9|Wishbot | at async CommandStore.load (/root/node/Customers/Wishbot/node_modules/@sapphire/pieces/dist/lib/structures/Store.js:89:26)
9|Wishbot | at async SlashCommand.reload (/root/node/Customers/Wishbot/node_modules/@sapphire/pieces/dist/lib/structures/Piece.js:94:9)
9|Wishbot | at async SlashCommand.reload (/root/node/Customers/Wishbot/node_modules/@sapphire/framework/dist/lib/structures/Command.js:108:5)
9|Wishbot | at async /root/node/Customers/Wishbot/node_modules/@sapphire/plugin-hmr/dist/lib/hmr.js:49:13
9|Wishbot | at async Object.fromAsync (/root/node/Customers/Wishbot/node_modules/@sapphire/result/dist/index.js:615:22)
9|Wishbot | at async handlePiecePathUpdate (/root/node/Customers/Wishbot/node_modules/@sapphire/plugin-hmr/dist/lib/hmr.js:47:20) {
9|Wishbot | type: 'EMPTY_MODULE',
9|Wishbot | path: '/root/node/Customers/Wishbot/src/commands/collection.js'
9|Wishbot | }
The command files load fine when the bot starts up and get executed without any problems
7 replies
SIASapphire - Imagine a framework
Created by Akanixon on 1/17/2023 in #discordjs-support
receiving invalid message id
No description
31 replies
SIASapphire - Imagine a framework
Created by Akanixon on 1/15/2023 in #sapphire-support
API Routes Handling
I'm currently delving into routes and handling them but I have problems finding how to hand the process off to a middleware like express-routers. I want to essentially just forward every request to the express-router but I currently have 2 roadblocks: 1. the route parameter seems to not allow for wildcards 2. methods don't support handling all event types Maybe I just miss something obvious or what I want to do is impossible, feel free to correct me 😄
45 replies