Custom listener name not applyingHey, I'm looking to put multiple listeners into the same file and I'm running into an issue where the name option isn't applying
As a quick reference, I am on the v14 PR although I believe it's unrelatedDebugging steps I've tried:
1. Initializing the name field in the constructor
2. Initializing the name field in a decorator
3. After the constructor, ignoring the read only warning and attempting to set name to a custom name
None of those have yielded successful results, when looking at it in a debugger and attempting to find the listener, it's using the file name
Looking at the source code for
https://github.com/sapphiredev/framework/blob/main/src/lib/structures/Listener.tsand
https://github.com/sapphiredev/pieces/blob/main/src/lib/structures/Piece.tsit seems like there's nothing that should be preventing this custom name from being applied but it isn't, any ideas on what might be causing this / further debugging steps?
Code:
export class SyncMessageDelete extends Listener {
public constructor(context: Listener.Context, options: Listener.Options) {
console.log(context, options);
super(context, {
...options,
event: "messageDelete",
name: "MessageDeletedWatcher",
});
}
public run(message: Message) {
console.log("Deleting message: ", message.id);
}
}
const sync_delete = bot.client.stores
.get("listeners")
.find((listener) => listener.name === "MessageDeletedWatcher");
Debugger screenshot: