Skip to content

I don't want default scope without default handler 🌚 #78

@PonomareVlad

Description

@PonomareVlad

commands/src/command.ts

Lines 151 to 162 in 6653e2a

if (!handler) {
handler = async (_ctx: Context, next: NextFunction) => await next();
this._hasHandler = false;
} else this._hasHandler = true;
this._options = { ...this._options, ...options };
if (this._options.prefix?.trim() === "") this._options.prefix = "/";
this._languages.set("default", { name: name, description });
if (handler) {
this.addToScope({ type: "default" }, handler);
}
return this;

 if (!handler) { // 1
   handler = async (_ctx: Context, next: NextFunction) => await next();
 } 

 // ...

 if (handler) { // 2
   this.addToScope({ type: "default" }, handler);
 } 

What ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions