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

Simplification & bug-fix of _extract_setting #28

Merged
merged 1 commit into from
Dec 18, 2017

Conversation

JacobJerrell
Copy link

@JacobJerrell JacobJerrell commented Nov 20, 2017

There was the potential for an inconsistency in the event that a user passed any argument other than on/off.

It would cause things like having the bot pm the user the setpm off message because PM's were actually on for the user.

This patch prevents that issue by giving a third possible return value of 2. If '2' is returned, the bot will make no changes, inform the user that it can't understand the argument, and show the user the arguments that are accepted for the setpm command.

The _extract_setting method has also been updated to stop hardcoding indexes, matching the above _extract_** methods

screen shot 2017-11-20 at 8 24 52 am

There was the potential for an inconsistency in the event that a user passed any argument other than on/off.

It would cause things like having the bot pm the user the setpm off message because PM's were actually on for the user.

This patch prevents that issue by giving a third possible return value of 2. If '2' is returned, the bot will make no changes, inform the user that it can't understand the argument, and show the user the arguments that are accepted for the setpm command.

The _extract_setting method has also been updated to stop hardcoding indexes, matching the above _extract_** methods
@kylesykes kylesykes merged commit 9577a69 into K-2L:develop Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants