Skip to content
This repository has been archived by the owner on Aug 27, 2018. It is now read-only.

Required Settings & Cleanup #283

Merged
merged 5 commits into from
Jun 26, 2017
Merged

Required Settings & Cleanup #283

merged 5 commits into from
Jun 26, 2017

Conversation

bdistin
Copy link
Contributor

@bdistin bdistin commented Jun 25, 2017

Proposed Semver Increment Bump: [MAJOR/MINOR/PATCH]

Minor

Changes Proposed in this Pull Request (List new items in CHANGELOG.MD)

  • Adds conf.requiredSettings to commands, to assert you have all required settingsGateway guild settings before running the command.

(If Applicable) What Issue does it fix?

Fixes... cleanup in argResolver && requiredFunctions

Copy link
Contributor

@kyranet kyranet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical issues.

if (!client.funcs.hasOwnProperty(func)) funcs.push(func);
});
if (!cmd.conf.requiredFuncs || cmd.conf.requiredFuncs.length === 0) return false;
const funcs = cmd.conf.requiredFuncs.filter(func => client.funcs.hasOwnProperty(func));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot a NOT operator.


exports.run = (client, msg, cmd) => {
if (!cmd.conf.requiredSettings || cmd.conf.requiredSettings.length === 0) return false;
const settings = cmd.conf.requiredSettings.filter(setting => msg.guildSettings[setting]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor

@kyranet kyranet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now 👍

@CyberiumShadow CyberiumShadow merged commit 5c886b3 into indev Jun 26, 2017
@CyberiumShadow CyberiumShadow deleted the requiredSettings&cleanup branch June 26, 2017 12:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants