Skip to content

Welcome max bot#174

Merged
wsf235 merged 2 commits intodevfrom
welcome-max-bot
Jun 18, 2018
Merged

Welcome max bot#174
wsf235 merged 2 commits intodevfrom
welcome-max-bot

Conversation

@wsf235
Copy link
Contributor

@wsf235 wsf235 commented Jun 18, 2018

syntax: !loop [time in seconds] [message to be looped]

example: !loop 20 Max-bot is constantly in operation and will loop this statement every 20 seconds

I feel as though someone can come along later and upgrade this function to maybe include more loops or format it better for time.

wsf235 added 2 commits June 18, 2018 16:41
syntax: !loop [time in seconds] [message to be looped]

example: !loop 20 Max-bot is constantly in operation and will loop this statement every 20 seconds
syntax: !loop [time in seconds] [message to be looped]

example: !loop 20 Max-bot is constantly in operation and will loop this statement every 20 seconds

I feel as though someone can come along later and upgrade this function to maybe include more loops or format it better for time.

// Check if the pre-existing toggle is true or false
// If the toggle is true, then set the toggle to false and turn off the loop
if (toggle !== false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can simplify with if (toggle) ...

clearInterval(interval);
newMessage.channel.send("Loop is off");
toggle = false;
} else if (toggle !== true) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can simplify with else if (!toggle)...

Copy link
Contributor

@Codemax999 Codemax999 left a comment

Choose a reason for hiding this comment

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

Awesome, added some small things about handling booleans. Other than that LGTM!

@wsf235
Copy link
Contributor Author

wsf235 commented Jun 18, 2018

Thank you much!
And for the most part, the way I handled the booleans was more so I could keep track of what I was doing in that case. Using toggle and !toggle sometimes mixes me up.

@wsf235 wsf235 merged commit 3f6a852 into dev Jun 18, 2018
@reactivepixel reactivepixel deleted the welcome-max-bot branch August 21, 2019 13:48
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