+
Skip to content

Conditional Commands is not works. #246

@grarich

Description

@grarich

I defined the confition function, but the command will be executed even if the condition is not true.

System Requirements
MacOS 12.0.1
NodeJs 16.13.1
discord-akairo/master
discord.js 13.3.1

/commands/test.ts

import { Command } from "discord-akairo";
import { Message } from "discord.js";

export default class TestCommand extends Command {
  constructor() {
    super("test", {
      aliases: ["test"],
      category: "Test",
      description: { content: "Test Command." },
    });
  }

  condition(message: Message): boolean {
    return message.author.id === "126485019500871680";
  }

  async exec(message: Message): Promise<Message> {
    return await message.channel.send("Test!");
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载