Error importing a plugin

here is my index.js - https://pastebin.com/3HDUAfVY Here is the plugin I'm trying to import and having an issue with - https://pastebin.com/45Nm9hSf I am not great with javascript, maybe I'm missing something? can someone point me in the right places?
Pastebin
Index.js - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
DDoSAttackCounter.js - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Solution:
you placed it inside of "src/commands", which the command store expects everything inside of there to extend the "Command" class, causing that error to occur as for how plugins are done: you can refer to here https://github.com/sapphiredev/plugins/tree/main/packages im unsure if there's a guide on making them or not...
GitHub
plugins/packages at main · sapphiredev/plugins
Plugins for the Sapphire Framework. Contribute to sapphiredev/plugins development by creating an account on GitHub.
Jump to solution
3 Replies
Zer0-1ne
Zer0-1neOP7mo ago
Here is my error
PS E:\Code\PSG\PSG-Elf-Master\PSG-Elf-Master> node src/index.js
Express listening on port 3000
Error when loading 'E:\Code\PSG\PSG-Elf-Master\PSG-Elf-Master\src\commands\DDoSAttackCounter.js': Error [EMPTY_MODULE]: A compatible class export was not found. [E:\Code\PSG\PSG-Elf-Master\PSG-Elf-Master\src\commands\DDoSAttackCounter.js]
at _LoaderStrategy.load (E:\Code\PSG\PSG-Elf-Master\PSG-Elf-Master\node_modules\@sapphire\pieces\dist\cjs\lib\strategies\LoaderStrategy.cjs:78:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async _CommandStore.loadPath (E:\Code\PSG\PSG-Elf-Master\PSG-Elf-Master\node_modules\@sapphire\pieces\dist\cjs\lib\structures\Store.cjs:299:26)
ire\framework\dist\cjs\lib\structures\CommandStore.cjs:42:5)
at async Promise.all (index 1)
at async _SapphireClient.login (E:\Code\PSG\PSG-Elf-Master\PSG-Elf-Master\node_modules\@sapphire\framework\dist\cjs\lib\SapphireClient.cjs:82:5) {
type: 'EMPTY_MODULE',
path: 'E:\\Code\\PSG\\PSG-Elf-Master\\PSG-Elf-Master\\src\\commands\\DDoSAttackCounter.js'
}
Logged In
[INFO] ApplicationCommandRegistries: Initializing...
[INFO] ApplicationCommandRegistries: Took 0ms to initialize.
PS E:\Code\PSG\PSG-Elf-Master\PSG-Elf-Master> node src/index.js
Express listening on port 3000
Error when loading 'E:\Code\PSG\PSG-Elf-Master\PSG-Elf-Master\src\commands\DDoSAttackCounter.js': Error [EMPTY_MODULE]: A compatible class export was not found. [E:\Code\PSG\PSG-Elf-Master\PSG-Elf-Master\src\commands\DDoSAttackCounter.js]
at _LoaderStrategy.load (E:\Code\PSG\PSG-Elf-Master\PSG-Elf-Master\node_modules\@sapphire\pieces\dist\cjs\lib\strategies\LoaderStrategy.cjs:78:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async _CommandStore.loadPath (E:\Code\PSG\PSG-Elf-Master\PSG-Elf-Master\node_modules\@sapphire\pieces\dist\cjs\lib\structures\Store.cjs:299:26)
ire\framework\dist\cjs\lib\structures\CommandStore.cjs:42:5)
at async Promise.all (index 1)
at async _SapphireClient.login (E:\Code\PSG\PSG-Elf-Master\PSG-Elf-Master\node_modules\@sapphire\framework\dist\cjs\lib\SapphireClient.cjs:82:5) {
type: 'EMPTY_MODULE',
path: 'E:\\Code\\PSG\\PSG-Elf-Master\\PSG-Elf-Master\\src\\commands\\DDoSAttackCounter.js'
}
Logged In
[INFO] ApplicationCommandRegistries: Initializing...
[INFO] ApplicationCommandRegistries: Took 0ms to initialize.
Solution
KaydaFox
KaydaFox7mo ago
you placed it inside of "src/commands", which the command store expects everything inside of there to extend the "Command" class, causing that error to occur as for how plugins are done: you can refer to here https://github.com/sapphiredev/plugins/tree/main/packages im unsure if there's a guide on making them or not
GitHub
plugins/packages at main · sapphiredev/plugins
Plugins for the Sapphire Framework. Contribute to sapphiredev/plugins development by creating an account on GitHub.
Zer0-1ne
Zer0-1neOP7mo ago
❤️ thank you
Want results from more Discord servers?
Add your server