Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Module: Messageflags

Paul edited this page Jul 17, 2020 · 2 revisions

The message flags module lets you get message flags for commands.

For example, you can name a command ping. But the user can add a flag called avarage to ping multiple times.

Configuration

The message flags module has one option, prefix. When the prefix is -, each argument that starts with - is considered a flag.

Default: -

Example

In the main file

myBot.addModule("messageflags", {
  prefix: "--"
});

In the command run method

run(message) {
  if (message.flags.includes("avarage")) {
    // .ping --avarage
  } else {
    // .ping
  }
}

Clone this wiki locally