yuuko
yuuko copied to clipboard
Deprecation: Client#setGlobalRequirements, Client ignoreGlobalRequirements option
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).