Skip to content

Commit

Permalink
feat(Plugin): add options option
Browse files Browse the repository at this point in the history
  • Loading branch information
SebestikCZ authored May 1, 2022
1 parent 6a43228 commit 830839a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/structures/Plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ const validationSchema = z
export class Plugin {
public name: string;
public run: (client: GClient) => any;
public options: Object;

public constructor(name: string, run: (client: GClient) => any) {
validationSchema
.parseAsync({ name, run, ...this })
.then(options => {
this.name = options.name;
this.run = options.run;
this.options = this;

Plugins.register(this);
})
Expand Down

0 comments on commit 830839a

Please sign in to comment.