yuuko icon indicating copy to clipboard operation
yuuko copied to clipboard

Deprecation: Client#setGlobalRequirements, Client ignoreGlobalRequirements option

Open eritbh opened this issue 4 years ago • 0 comments

The Client#setGlobalRequirements method and the ignoreGlobalRequirements client option were both deprecated in #75, with the addition of the globalCommandRequirements client option.

Uses of Client#setGlobalRequirements can be replaced with usage of the globalCommandRequirements option like so:

// old
import {Client} from 'yuuko';
const bot = new Client({
  ...
});
bot.setGlobalRequirements(yourGlobalRequirements);

// new
import {Client} from 'yuuko';
const bot = new Client({
  globalCommandRequirements: yourGlobalRequirements,
  ...
});

Uses of the ignoreGlobalRequirements option can be replaced with conditionally setting globalCommandRequirements, like so:

// old
import {Client} from 'yuuko';
const bot = new Client({
  globalCommandRequirements: yourGlobalRequirements,
  ignoreGlobalRequirements: process.env.NODE_ENV !== 'production',
  ...
});

// new
import {Client} from 'yuuko';
const bot = new Client({
  globalCommandRequirements: process.env.NODE_ENV !== 'production' ? {} : yourGlobalRequirements,
  ...
});

Client#setGlobalRequirements and the ignoreGlobalRequirements client option will be removed in the 3.0.0 release (#94).

eritbh avatar Aug 22 '21 01:08 eritbh