Any common guideline for making plugins?

So what I'm trying to do is to create a module of commands which made available through plugin system. I used the following template to start up but it's currently not able to run properly. Problem : I mostly followed other plugins as example where you create a class extending Plugin and define the hook functions. Later on registering the hooks to the SapphireClient instance. My code roughly looks like this
// register.ts
import { Plugin, SapphireClient, postLogin } from '@sapphire/framework';

export class WagakkiPlugin extends Plugin {
public static [postLogin](this: SapphireClient): void {
console.log('====wagakki=== initializing');
// code omitted
}
}
SapphireClient.plugins.registerPostLoginHook(WagakkiPlugin[postLogin], 'Wagakki-PostLogin');
console.log('Sapphire has loaded wagakki');
// register.ts
import { Plugin, SapphireClient, postLogin } from '@sapphire/framework';

export class WagakkiPlugin extends Plugin {
public static [postLogin](this: SapphireClient): void {
console.log('====wagakki=== initializing');
// code omitted
}
}
SapphireClient.plugins.registerPostLoginHook(WagakkiPlugin[postLogin], 'Wagakki-PostLogin');
console.log('Sapphire has loaded wagakki');
Some part of the code are omitted since not only it doesn't work, I am not even getting any logs from the postLogin hook. The only log I received is "Sapphire has loaded wagakki" and that's it. Tried other hooks as well (preInitialization, postInitialization) and still same. Any ideas where did I do wrong? Additional context: I'm developing this plugin as separate module, which later used by my main codebase through yarn link since it's still in local.
GitHub
GitHub - sapphiredev/sapphire-template: Template to be used for Sap...
Template to be used for Sapphire Project repositories - sapphiredev/sapphire-template
3 Replies
Favna
Favna6mo ago
Sapphire template was archived for a reason.. it's not maintained anymore. anyway from the info provided I have no idea. Are you compiling your TS code between attempts?
白雪はるか
白雪はるかOP6mo ago
Yes. I build the project on each attempt. The output is consistently showing for anything that is not inside the hook (like the console log on top level). Considering the template was archived, any pointers to other resource/template I can use?
Favna
Favna6mo ago
the plugins monorepo and then grab a specific folder from it and de-mono-repo it
Want results from more Discord servers?
Add your server