Marino
Marino
SIASapphire - Imagine a framework
Created by Marino on 6/29/2024 in #sapphire-support
Only receiving interactions on local machine
Hi all, The title is quite self explanatory, but a little more detail here. I've been trying to get my bot to work on my production machine but it looks like interactions aren't being received on there. However, when I run the bot on my local machine, the interaction goes through perfectly fine. Any idea as to what this might be? I can share more detail if needed Thanks in advance 😄
3 replies
SIASapphire - Imagine a framework
Created by Marino on 1/11/2024 in #sapphire-support
Weird type error
TS2345: Argument of type 'PieceContext<keyof StoreRegistryEntries>' is not assignable to parameter of type 'LoaderContext'.
Types of property 'store' are incompatible.
Type 'ArgumentStore | CommandStore | InteractionHandlerStore | ListenerStore | PreconditionStore' is not assignable to type 'InteractionHandlerStore'.
Property 'run' is missing in type 'ArgumentStore' but required in type 'InteractionHandlerStore'.

17 super(ctx, {
~~~

node_modules/.pnpm/@sapphire+framework@4.8.5/node_modules/@sapphire/framework/dist/cjs/index.d.ts:441:5
441 run(interaction: Interaction): Promise<boolean>;
~~~
'run' is declared here.
TS2345: Argument of type 'PieceContext<keyof StoreRegistryEntries>' is not assignable to parameter of type 'LoaderContext'.
Types of property 'store' are incompatible.
Type 'ArgumentStore | CommandStore | InteractionHandlerStore | ListenerStore | PreconditionStore' is not assignable to type 'InteractionHandlerStore'.
Property 'run' is missing in type 'ArgumentStore' but required in type 'InteractionHandlerStore'.

17 super(ctx, {
~~~

node_modules/.pnpm/@sapphire+framework@4.8.5/node_modules/@sapphire/framework/dist/cjs/index.d.ts:441:5
441 run(interaction: Interaction): Promise<boolean>;
~~~
'run' is declared here.
export class DeleteInviteButtonHandler extends InteractionHandler {
public constructor(ctx: PieceContext, options: InteractionHandler.Options) {
super(ctx, {
...options,
interactionHandlerType: InteractionHandlerTypes.Button,
});
}
...
export class DeleteInviteButtonHandler extends InteractionHandler {
public constructor(ctx: PieceContext, options: InteractionHandler.Options) {
super(ctx, {
...options,
interactionHandlerType: InteractionHandlerTypes.Button,
});
}
...
14 replies
SIASapphire - Imagine a framework
Created by Marino on 5/1/2023 in #sapphire-support
Sapphire Paginated Embed
I have a paginated embed which works fine by the way. I just need a way to be able to select one field from all the embed fields and then run a function based on which field was selected via a string select menu. Can anyone please guide me in the right direction?
18 replies
SIASapphire - Imagine a framework
Created by Marino on 4/22/2023 in #sapphire-support
PaginatedMessageEmbedFields select menu
I seem to find myself way too often in this forum, so, here we go again. Is there a way to disable the select menu on this class?
7 replies
SIASapphire - Imagine a framework
Created by Marino on 4/18/2023 in #sapphire-support
@sapphire/shapeshift ExpectedConstraintError
Hi all, currently creating a command with choices. Here's the code I wrote, but for some reason, this weird error pops up when applying ...choices to #addChoices
interface ShopItem {
name: string;
type: "aircraft" | "hangar";
size?: string;
price: number;
}

const combinedShop: ShopItem[] = [];

for (const hangar of hangarShop) {
combinedShop.push({
name: hangar.name,
type: "hangar",
size: hangar.type,
price: hangar.price,
});
}

for (const aircraft of aircraftShop) {
combinedShop.push({
name: aircraft.name,
type: "aircraft",
price: aircraft.price,
});
}

const choices = combinedShop.map((item) => ({
name: item.name,
value: item.name,
}));

.addSubcommand((command) =>
command
.setName("buy")
.setDescription("Buy an item from the shop")
.addStringOption((option) =>
option
.setName("item")
.setDescription("An item to purchase")
.setRequired(true)
.addChoices(...choices)
)
)
interface ShopItem {
name: string;
type: "aircraft" | "hangar";
size?: string;
price: number;
}

const combinedShop: ShopItem[] = [];

for (const hangar of hangarShop) {
combinedShop.push({
name: hangar.name,
type: "hangar",
size: hangar.type,
price: hangar.price,
});
}

for (const aircraft of aircraftShop) {
combinedShop.push({
name: aircraft.name,
type: "aircraft",
price: aircraft.price,
});
}

const choices = combinedShop.map((item) => ({
name: item.name,
value: item.name,
}));

.addSubcommand((command) =>
command
.setName("buy")
.setDescription("Buy an item from the shop")
.addStringOption((option) =>
option
.setName("item")
.setDescription("An item to purchase")
.setRequired(true)
.addChoices(...choices)
)
)
[ERROR] Encountered error while handling the command application command registry for command "shop" at path "D:\Development\@airbridge\bot\src\commands\shop.ts" ExpectedConstraintError > s.number.lessThanOrEqual
Invalid number value

Expected: expected <= 25

Received:
| 34
[ERROR] Encountered error while handling the command application command registry for command "shop" at path "D:\Development\@airbridge\bot\src\commands\shop.ts" ExpectedConstraintError > s.number.lessThanOrEqual
Invalid number value

Expected: expected <= 25

Received:
| 34
10 replies
SIASapphire - Imagine a framework
Created by Marino on 4/14/2023 in #sapphire-support
Passing data from one handler to the other
Say I have a Modal Submit Handler and then inside that handler, I create a button for a new reply, and when pressing that button, is there a way I can pass the data received from the modal to the next handler (in this case the Button Interaction Handler) Thanks in advance 🙂
25 replies
SIASapphire - Imagine a framework
Created by Marino on 4/4/2023 in #sapphire-support
@sapphire/type installation script error
$ pnpm i
Lockfile is up to date, resolution step is skipped
Packages: +327
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 327, reused 327, downloaded 0, added 0, done
node_modules/.pnpm/@sapphire+type@2.2.5-next.cf34f61.0/node_modules/@sapphire/type: Running install script, failed in 12.7s
.../node_modules/@sapphire/type install$ node-pre-gyp install --fallback-to-build
$ pnpm i
Lockfile is up to date, resolution step is skipped
Packages: +327
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 327, reused 327, downloaded 0, added 0, done
node_modules/.pnpm/@sapphire+type@2.2.5-next.cf34f61.0/node_modules/@sapphire/type: Running install script, failed in 12.7s
.../node_modules/@sapphire/type install$ node-pre-gyp install --fallback-to-build
21 replies