choke
choke
SIASapphire - Imagine a framework
Created by choke on 2/16/2025 in #sapphire-support
Better way of displaying an error response to the user for components? (this.none)
Hi, I was wondering if you could send an ephemeral message to the user when the interaction component (lets say a button) returns this.none() or do i have to have to pass an argument to this.some() with the error
18 replies
SIASapphire - Imagine a framework
Created by choke on 2/15/2025 in #sapphire-support
PaginatedMessage on a user-installed app inside a guild will return thisMazeWasNotMeantForYouContent
When running a slash command with PaginatedMessage, the bot will only return the intended response in DMs and Group Chats Using the command in Guilds will cause the interaction to return #thisMazeWasNotMeantForYouContent
8 replies
SIASapphire - Imagine a framework
Created by choke on 2/11/2025 in #sapphire-support
Accessing a public method in a listener's class
Hi, I currently have a public method on my listener that i want to access from another listener, below is an example of my current code:
...
export class UserEvent extends Listener {
private interval: NodeJS.Timeout | null = null;

public override run() {
if (!config.enabled) return;
this.startInterval();
}

public async resetInterval() {
if (this.interval) {
clearInterval(this.interval);
this.startInterval();
}
}

private startInterval() {
this.interval = setInterval(async () => {
this.assignMember();
}, 1000 * 60 * 60);
}
...
...
export class UserEvent extends Listener {
private interval: NodeJS.Timeout | null = null;

public override run() {
if (!config.enabled) return;
this.startInterval();
}

public async resetInterval() {
if (this.interval) {
clearInterval(this.interval);
this.startInterval();
}
}

private startInterval() {
this.interval = setInterval(async () => {
this.assignMember();
}, 1000 * 60 * 60);
}
...
my goal here is to call resetInterval() from another listener, but i currently have no idea how to call it without calling new on the listener above.
5 replies