Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation: Client#setGlobalRequirements, Client ignoreGlobalRequirements option #89

Open
eritbh opened this issue Aug 22, 2021 · 0 comments · May be fixed by #94
Open

Deprecation: Client#setGlobalRequirements, Client ignoreGlobalRequirements option #89

eritbh opened this issue Aug 22, 2021 · 0 comments · May be fixed by #94
Labels
deprecation details about deprecated features
Milestone

Comments

@eritbh
Copy link
Owner

eritbh commented Aug 22, 2021

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 eritbh added the deprecation details about deprecated features label Aug 22, 2021
@eritbh eritbh added this to the v3 milestone Aug 22, 2021
@eritbh eritbh closed this as completed Aug 22, 2021
@eritbh eritbh linked a pull request Sep 6, 2021 that will close this issue
@eritbh eritbh reopened this Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation details about deprecated features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant