yibuh
yibuh
Explore posts from servers
SIASapphire - Imagine a framework
Created by yibuh on 11/16/2023 in #sapphire-support
Listeners and Handlers not registering interactions/events
Everything's working now!
17 replies
SIASapphire - Imagine a framework
Created by yibuh on 11/16/2023 in #sapphire-support
Listeners and Handlers not registering interactions/events
I'll redeploy and let you know 🙂 Thanks for the quick fix!
17 replies
SIASapphire - Imagine a framework
Created by yibuh on 11/16/2023 in #sapphire-support
Listeners and Handlers not registering interactions/events
Sure, I'll leave my dependencies versions here, in case it's useful:
"@sapphire/decorators": "^6.0.2",
"@sapphire/discord.js-utilities": "^7.1.2",
"@sapphire/framework": "^4.8.1",
"@sapphire/plugin-logger": "^3.0.7",
"@sapphire/plugin-subcommands": "^5.1.0",
"@sapphire/time-utilities": "^1.7.10",
"@sapphire/utilities": "^3.13.0",
"@sapphire/cli": "^1.8.0",
"@sapphire/prettier-config": "^2.0.0",
"@sapphire/ts-config": "^5.0.0",
"@sapphire/decorators": "^6.0.2",
"@sapphire/discord.js-utilities": "^7.1.2",
"@sapphire/framework": "^4.8.1",
"@sapphire/plugin-logger": "^3.0.7",
"@sapphire/plugin-subcommands": "^5.1.0",
"@sapphire/time-utilities": "^1.7.10",
"@sapphire/utilities": "^3.13.0",
"@sapphire/cli": "^1.8.0",
"@sapphire/prettier-config": "^2.0.0",
"@sapphire/ts-config": "^5.0.0",
17 replies
SIASapphire - Imagine a framework
Created by yibuh on 11/16/2023 in #sapphire-support
Listeners and Handlers not registering interactions/events
Still not working after updates, maybe I'm doing something wrong?
17 replies
SIASapphire - Imagine a framework
Created by yibuh on 11/16/2023 in #sapphire-support
Listeners and Handlers not registering interactions/events
Updating dependencies and redeploying, I'll let you know if it works 🙂
17 replies
SIASapphire - Imagine a framework
Created by yibuh on 11/16/2023 in #sapphire-support
Listeners and Handlers not registering interactions/events
Oh! My bad then, thought updates were already finished. I'll do that, thanks 🙂
17 replies
SIASapphire - Imagine a framework
Created by yibuh on 11/16/2023 in #sapphire-support
Listeners and Handlers not registering interactions/events
My project was setup using the Sapphire CLI's starter template
17 replies
SIASapphire - Imagine a framework
Created by yibuh on 11/16/2023 in #sapphire-support
Listeners and Handlers not registering interactions/events
No description
17 replies
SIASapphire - Imagine a framework
Created by yibuh on 11/16/2023 in #sapphire-support
Deployment failing
Thanks for your quick replies! 🙂
8 replies
SIASapphire - Imagine a framework
Created by yibuh on 11/6/2023 in #sapphire-support
Handle secondary bots from main
Thank you
8 replies
SIASapphire - Imagine a framework
Created by yibuh on 11/6/2023 in #sapphire-support
Handle secondary bots from main
secondaryBotOne and secondaryBoTwo being instances of SapphireClient
8 replies
SIASapphire - Imagine a framework
Created by yibuh on 11/6/2023 in #sapphire-support
Handle secondary bots from main
I'd log in with each bot when the main bot logs in
8 replies
SIASapphire - Imagine a framework
Created by yibuh on 11/6/2023 in #sapphire-support
Handle secondary bots from main
Thank you for your answer. I'd like to ask one thing, probably a dumb question: would it be possible to store each client instance in a collection (or an array) inside the container and access each instance through that? For example:
container.bots = [
{
client: secondaryBotOne,
busy: false
},
{
client: secondaryBotTwo,
busy: false
}
]
container.bots = [
{
client: secondaryBotOne,
busy: false
},
{
client: secondaryBotTwo,
busy: false
}
]
8 replies
SIASapphire - Imagine a framework
Created by yibuh on 10/29/2023 in #sapphire-support
The inferred type of 'parse' cannot be named without a reference to...
I did not, that should be the issue. I switched back to npm as I wasn't able to fix it. Thank you 🙂
8 replies
SIASapphire - Imagine a framework
Created by yibuh on 10/29/2023 in #sapphire-support
The inferred type of 'parse' cannot be named without a reference to...
Makes no sense though, as I don't even use them
8 replies
SIASapphire - Imagine a framework
Created by yibuh on 10/29/2023 in #sapphire-support
The inferred type of 'parse' cannot be named without a reference to...
Adding these imports to the top of the file makes the error dissapear: import { Result, None, Option } from '@sapphire/framework';
8 replies
SIASapphire - Imagine a framework
Created by yibuh on 9/28/2023 in #sapphire-support
AutoComplete subcommand name/id
Thank you, I'm dumb. Thought options were different for autocomplete interactions haha
5 replies
SIASapphire - Imagine a framework
Created by yibuh on 6/15/2023 in #sapphire-support
Creating a button handler
My buttons are loaded in my container but for some reason nothing is happening once I clic the button. Any hints on why this is happening?
8 replies
SIASapphire - Imagine a framework
Created by yibuh on 6/15/2023 in #sapphire-support
Creating a button handler
buttonHandler.ts
import { InteractionHandler, InteractionHandlerTypes, container, type PieceContext } from '@sapphire/framework';
import type { ButtonInteraction } from 'discord.js';
import type { ButtonExport } from '../../lib/interactions';

export class ButtonHandler extends InteractionHandler {
public constructor(ctx: PieceContext, options: InteractionHandler.Options) {
super(ctx, {
...options,
interactionHandlerType: InteractionHandlerTypes.Button
});
}

public override async parse(interaction: ButtonInteraction) {
const button = container.buttons.get(interaction.customId);
if (!button) return this.none();
return this.some(button);
}

public async run(interaction: ButtonInteraction) {
const button: ButtonExport | undefined = container.buttons.get(interaction.customId as string);
await button?.execute(interaction);
}
}
import { InteractionHandler, InteractionHandlerTypes, container, type PieceContext } from '@sapphire/framework';
import type { ButtonInteraction } from 'discord.js';
import type { ButtonExport } from '../../lib/interactions';

export class ButtonHandler extends InteractionHandler {
public constructor(ctx: PieceContext, options: InteractionHandler.Options) {
super(ctx, {
...options,
interactionHandlerType: InteractionHandlerTypes.Button
});
}

public override async parse(interaction: ButtonInteraction) {
const button = container.buttons.get(interaction.customId);
if (!button) return this.none();
return this.some(button);
}

public async run(interaction: ButtonInteraction) {
const button: ButtonExport | undefined = container.buttons.get(interaction.customId as string);
await button?.execute(interaction);
}
}
8 replies
SIASapphire - Imagine a framework
Created by yibuh on 6/13/2023 in #sapphire-support
New to Sapphire! Where should I start?
Thank you! I will check those bots and start coding right away
4 replies