Sean
Sean
Explore posts from servers
SIASapphire - Imagine a framework
Created by Nemokosch on 8/5/2024 in #sapphire-support
Statefulness and data sharing for Pieces
For example, I have this code in my main function
container.redis = redisClient;
container.cardCache = new Map<string, any>();
container.redis = redisClient;
container.cardCache = new Map<string, any>();
And then I can access redis from calling this.container.redis.whatever, same for cardCache
52 replies
SIASapphire - Imagine a framework
Created by Nemokosch on 8/5/2024 in #sapphire-support
Statefulness and data sharing for Pieces
Most people just attach properties to container (accessible in pieces with this.container and importable elsewhere
52 replies
SIASapphire - Imagine a framework
Created by Sean on 8/1/2024 in #sapphire-support
Piece not loading when stores.register() is called
Another quick question, Im getting this error when I try and load a piece, I don't depend on discord.js anywhere though, so I'm confused on where it's coming from (Also that path is wrong but it seems to find it ok
Error when loading 'C:\Users\outra\olp-nixos-config\update-tool\server\dist\messages\currentVersion.js': file:///C:/Users/outra/node_modules/@sapphire/discord.js-utilities/dist/index.mjs:3
import { MessagePayload, MessageEmbed, Permissions } from 'discord.js';
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async MessageLoaderStrategy.load (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/strategies/LoaderStrategy.mjs:45:20)
at async MessageStore.loadPath (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/structures/Store.mjs:270:26)
at async MessageStore.loadAll (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/structures/Store.mjs:185:24)
at async Promise.all (index 0)
at async _StoreRegistry.load (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/structures/StoreRegistry.mjs:28:5)
at async file:///C:/Users/outra/olp-nixos-config/update-tool/server/dist/index.js:13:1
Error when loading 'C:\Users\outra\olp-nixos-config\update-tool\server\dist\messages\currentVersion.js': file:///C:/Users/outra/node_modules/@sapphire/discord.js-utilities/dist/index.mjs:3
import { MessagePayload, MessageEmbed, Permissions } from 'discord.js';
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async MessageLoaderStrategy.load (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/strategies/LoaderStrategy.mjs:45:20)
at async MessageStore.loadPath (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/structures/Store.mjs:270:26)
at async MessageStore.loadAll (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/structures/Store.mjs:185:24)
at async Promise.all (index 0)
at async _StoreRegistry.load (file:///C:/Users/outra/olp-nixos-config/update-tool/server/node_modules/@sapphire/pieces/dist/esm/lib/structures/StoreRegistry.mjs:28:5)
at async file:///C:/Users/outra/olp-nixos-config/update-tool/server/dist/index.js:13:1
10 replies
SIASapphire - Imagine a framework
Created by Sean on 8/1/2024 in #sapphire-support
Piece not loading when stores.register() is called
Oh, I didn't have to do that the last time I used pieces, It might have been framework doing it for me though
10 replies
SIASapphire - Imagine a framework
Created by HellCatVN on 6/9/2023 in #sapphire-support
Is there anyway using Subcommand plugin with Slash command
Builders also make your code easier to maintain, as it abstracts changes made by discord away from you and to the libary (discord.js, in this case)
15 replies
SIASapphire - Imagine a framework
Created by Sean on 5/30/2023 in #sapphire-support
Getting the HTTP status code of a @sapphire/fetch request
So HCB's transparency API responds with a 404 if it can't find the org. I need to know when it responds with a 404
7 replies