The alwaysObtain option in commands

TIP

alwaysObtain only affects message commands.

The alwaysObtain option does a simple thing. Arguments in the first message initiating the command do not count.

This example is to showcase in which cases alwaysObtain would be useful:

const { Command, ArgumentType } = require("gcommands");

module.exports = class extends Command {
  constructor(client) {
    super(client, {
      name: "repeat",
      description: "Repeat this please",
      alwaysObtain: false // Or true
      args: [
        {
          name: 'channel', // This argument is just a example, we will not use it
          description: 'channel',
          type: ArgumentType.CHANNEL,
          required: true,
        },
        {
          name: 'string',
          description: 'A string',
          type: ArgumentType.STRING,
          required: true,
        }
      ]
    });
  }

  run({ respond, objectArgs }) {
    respond(objectArgs.string)
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29