Tejas
Tejas
Explore posts from servers
SIASapphire - Imagine a Framework
Created by Tejas on 4/21/2025 in #sapphire-support
Error using User Apps in my bot
oh my bad I stopped reading the docs on data transformers and kept wondering about this
27 replies
SIASapphire - Imagine a Framework
Created by Tejas on 4/21/2025 in #sapphire-support
Error using User Apps in my bot
In other words how do I securely know who the user is in a route handler if all the state is in a cookie and I'm not querying or validating it explicitly?
27 replies
SIASapphire - Imagine a Framework
Created by Tejas on 4/21/2025 in #sapphire-support
Error using User Apps in my bot
Let's say I have a simple route like this
@ApplyOptions<Route.Options>({ route: "guild/:guildId/delete-settings" })
export class DeleteSettingsRoute extends Route {
async run(request: ApiRequest, response: ApiResponse) {
const { guildId } = request.params;
const { userId, token } = request.query;

if (!userId || !token) {
return response.status(401).json({ error: "Unauthorized" });
}

const isAdmin = await checkIfGuildAdmin(guildId, userId, token);
if (!isAdmin) {
return response.status(403).json({ error: "Forbidden" });
}

return response.json({ success: true });
}
}
@ApplyOptions<Route.Options>({ route: "guild/:guildId/delete-settings" })
export class DeleteSettingsRoute extends Route {
async run(request: ApiRequest, response: ApiResponse) {
const { guildId } = request.params;
const { userId, token } = request.query;

if (!userId || !token) {
return response.status(401).json({ error: "Unauthorized" });
}

const isAdmin = await checkIfGuildAdmin(guildId, userId, token);
if (!isAdmin) {
return response.status(403).json({ error: "Forbidden" });
}

return response.json({ success: true });
}
}
In this ex, I'm relying on userId and token being passed in manually to verify access. but with the session based approach you're talking abt (cookie + credentials: true), how should I identify and authorize the user server side if I'm not storing anything backend-side or decoding a JWT?
27 replies
SIASapphire - Imagine a Framework
Created by Tejas on 4/21/2025 in #sapphire-support
Error using User Apps in my bot
No description
27 replies
SIASapphire - Imagine a Framework
Created by Tejas on 4/21/2025 in #sapphire-support
Error using User Apps in my bot
No description
27 replies
SIASapphire - Imagine a Framework
Created by Tejas on 4/21/2025 in #sapphire-support
Error using User Apps in my bot
No description
27 replies
SIASapphire - Imagine a Framework
Created by Tejas on 4/21/2025 in #sapphire-support
Error using User Apps in my bot
so why are these checks running on user apps then, shouln't they be an exception?
27 replies
SIASapphire - Imagine a Framework
Created by Tejas on 4/21/2025 in #sapphire-support
Error using User Apps in my bot
I thought it would be considered a DM channel in user apps :/ so the cmd would execute
27 replies
SIASapphire - Imagine a Framework
Created by Tejas on 4/21/2025 in #sapphire-support
Error using User Apps in my bot
It's
runIn: [CommandOptionsRunTypeEnum.GuildAny, CommandOptionsRunTypeEnum.Dm],
runIn: [CommandOptionsRunTypeEnum.GuildAny, CommandOptionsRunTypeEnum.Dm],
27 replies
SIASapphire - Imagine a Framework
Created by Tejas on 4/21/2025 in #sapphire-support
Error using User Apps in my bot
But it's a user application cmd how does perms in that server effect it?
27 replies
SIASapphire - Imagine a Framework
Created by Tejas on 4/21/2025 in #sapphire-support
Error using User Apps in my bot
Rest of the error
2025-04-21 14:37:53 - ERROR - at async _CorePrecondition.fetchChannelFromInteraction (C:\Users\Tejas\Desktop\Source-Codes\Bots\rudescore\rudescore-rewrite\node_modules\.pnpm\@sapphire+framework@5.3.4\node_modules\@sapphire\framework\src\lib\structures\Precondition.ts:52:20)
2025-04-21 14:37:53 - ERROR - at async _CorePrecondition.chatInputRun (C:\Users\Tejas\Desktop\Source-Codes\Bots\rudescore\rudescore-rewrite\node_modules\.pnpm\@sapphire+framework@5.3.4\node_modules\@sapphire\framework\src\preconditions\RunIn.ts:34:24)
2025-04-21 14:37:53 - ERROR - at async Object.chatInputSequential (C:\Users\Tejas\Desktop\Source-Codes\Bots\rudescore\rudescore-rewrite\node_modules\.pnpm\@sapphire+framework@5.3.4\node_modules\@sapphire\framework\src\lib\utils\preconditions\conditions\PreconditionConditionAnd.ts:25:19)
2025-04-21 14:37:53 - ERROR - at async _CoreListener.run (C:\Users\Tejas\Desktop\Source-Codes\Bots\rudescore\rudescore-rewrite\node_modules\.pnpm\@sapphire+framework@5.3.4\node_modules\@sapphire\framework\src\listeners\application-commands\chat-input\CorePreChatInputCommandRun.ts:21:23) {
2025-04-21 14:37:53 - ERROR - requestBody: [Object],
2025-04-21 14:37:53 - ERROR - rawError: [Object],
2025-04-21 14:37:53 - ERROR - code: 50001,
2025-04-21 14:37:53 - ERROR - status: 403,
2025-04-21 14:37:53 - ERROR - method: 'GET',
2025-04-21 14:37:53 - ERROR - url: 'https://discord.com/api/v10/channels/831168306634686474'
2025-04-21 14:37:53 - ERROR - }
2025-04-21 14:37:53 - ERROR - at async _CorePrecondition.fetchChannelFromInteraction (C:\Users\Tejas\Desktop\Source-Codes\Bots\rudescore\rudescore-rewrite\node_modules\.pnpm\@sapphire+framework@5.3.4\node_modules\@sapphire\framework\src\lib\structures\Precondition.ts:52:20)
2025-04-21 14:37:53 - ERROR - at async _CorePrecondition.chatInputRun (C:\Users\Tejas\Desktop\Source-Codes\Bots\rudescore\rudescore-rewrite\node_modules\.pnpm\@sapphire+framework@5.3.4\node_modules\@sapphire\framework\src\preconditions\RunIn.ts:34:24)
2025-04-21 14:37:53 - ERROR - at async Object.chatInputSequential (C:\Users\Tejas\Desktop\Source-Codes\Bots\rudescore\rudescore-rewrite\node_modules\.pnpm\@sapphire+framework@5.3.4\node_modules\@sapphire\framework\src\lib\utils\preconditions\conditions\PreconditionConditionAnd.ts:25:19)
2025-04-21 14:37:53 - ERROR - at async _CoreListener.run (C:\Users\Tejas\Desktop\Source-Codes\Bots\rudescore\rudescore-rewrite\node_modules\.pnpm\@sapphire+framework@5.3.4\node_modules\@sapphire\framework\src\listeners\application-commands\chat-input\CorePreChatInputCommandRun.ts:21:23) {
2025-04-21 14:37:53 - ERROR - requestBody: [Object],
2025-04-21 14:37:53 - ERROR - rawError: [Object],
2025-04-21 14:37:53 - ERROR - code: 50001,
2025-04-21 14:37:53 - ERROR - status: 403,
2025-04-21 14:37:53 - ERROR - method: 'GET',
2025-04-21 14:37:53 - ERROR - url: 'https://discord.com/api/v10/channels/831168306634686474'
2025-04-21 14:37:53 - ERROR - }
27 replies
SIASapphire - Imagine a Framework
Created by Tejas on 4/10/2025 in #sapphire-support
Commands `status-rewards` and `status-rewards-admin` don't register on Discord
@mallusrgreat am not sure this could be a reason but try this once
16 replies
SIASapphire - Imagine a Framework
Created by Tejas on 4/10/2025 in #sapphire-support
Commands `status-rewards` and `status-rewards-admin` don't register on Discord
Already tried that! still doesnt work
16 replies
SIASapphire - Imagine a Framework
Created by mallusrgreat on 4/3/2025 in #sapphire-support
i18n not giving correct strings
correct
27 replies
SIASapphire - Imagine a Framework
Created by mallusrgreat on 4/3/2025 in #sapphire-support
i18n not giving correct strings
fetchLanguage(ctx) {
return ctx.interactionGuildLocale || ctx.interactionLocale || "en-US";
}
fetchLanguage(ctx) {
return ctx.interactionGuildLocale || ctx.interactionLocale || "en-US";
}
27 replies
SIASapphire - Imagine a Framework
Created by Tejas on 6/27/2024 in #sapphire-support
error: A compatible class export was not found.
My bad they were interaction-handlers and I had them in the folder meant fo listener's
7 replies
SIASapphire - Imagine a Framework
Created by Tejas on 6/27/2024 in #sapphire-support
error: A compatible class export was not found.
1. 5.2.1 2.
src
├───commands
├───enums
├───interfaces
├───languages
│ └───en-US
├───listeners
└───structures
src
├───commands
├───enums
├───interfaces
├───languages
│ └───en-US
├───listeners
└───structures
3. No 4. "module": "src/index.ts" 5. Am using Bun 6. N/A
7 replies
SIASapphire - Imagine a Framework
Created by Tejas on 6/27/2024 in #sapphire-support
error: A compatible class export was not found.
Error
Error when loading 'D:\old-drive\Source-Codes\Bots\TicketZ-bot\src\listeners\buttonHandler.ts': 9 | LoaderErrorType2["UnknownStore"] = "UNKNOWN_STORE";
10 | return LoaderErrorType2;
11 | })(LoaderErrorType || {});
12 | var _LoaderError = class _LoaderError extends Error {
13 | constructor(type, message) {
14 | super(message);
^
error: A compatible class export was not found. [D:\old-drive\Source-Codes\Bots\TicketZ-bot\src\listeners\buttonHandler.ts]
path: "D:\old-drive\Source-Codes\Bots\TicketZ-bot\src\listeners\buttonHandler.ts"
at new _LoaderError (D:\old-drive\Source-Codes\Bots\TicketZ-bot\node_modules\@sapphire\pieces\dist\esm\lib\errors\LoaderError.mjs:14:5)
at new _MissingExportsError (D:\old-drive\Source-Codes\Bots\TicketZ-bot\node_modules\@sapphire\pieces\dist\esm\lib\errors\MissingExportsError.mjs:6:5)
at D:\old-drive\Source-Codes\Bots\TicketZ-bot\node_modules\@sapphire\pieces\dist\esm\lib\strategies\LoaderStrategy.mjs:63:13
Error when loading 'D:\old-drive\Source-Codes\Bots\TicketZ-bot\src\listeners\buttonHandler.ts': 9 | LoaderErrorType2["UnknownStore"] = "UNKNOWN_STORE";
10 | return LoaderErrorType2;
11 | })(LoaderErrorType || {});
12 | var _LoaderError = class _LoaderError extends Error {
13 | constructor(type, message) {
14 | super(message);
^
error: A compatible class export was not found. [D:\old-drive\Source-Codes\Bots\TicketZ-bot\src\listeners\buttonHandler.ts]
path: "D:\old-drive\Source-Codes\Bots\TicketZ-bot\src\listeners\buttonHandler.ts"
at new _LoaderError (D:\old-drive\Source-Codes\Bots\TicketZ-bot\node_modules\@sapphire\pieces\dist\esm\lib\errors\LoaderError.mjs:14:5)
at new _MissingExportsError (D:\old-drive\Source-Codes\Bots\TicketZ-bot\node_modules\@sapphire\pieces\dist\esm\lib\errors\MissingExportsError.mjs:6:5)
at D:\old-drive\Source-Codes\Bots\TicketZ-bot\node_modules\@sapphire\pieces\dist\esm\lib\strategies\LoaderStrategy.mjs:63:13
7 replies
SIASapphire - Imagine a Framework
Created by Tejas on 6/23/2024 in #sapphire-support
Message commands help
No description
38 replies
SIASapphire - Imagine a Framework
Created by Tejas on 6/23/2024 in #sapphire-support
Message commands help
Alright lemme see
38 replies