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

updates key_script to store 5 key_holder(colorwise) #17

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

guptaprakhariitr
Copy link
Member

No description provided.

scripts/keys.coffee Outdated Show resolved Hide resolved
scripts/keys.coffee Outdated Show resolved Hide resolved
scripts/keys.coffee Outdated Show resolved Hide resolved
@Arnesh07
Copy link
Member

LGTM! @aseem09 Please review this PR once. Also, @guptaprakhariitr commit name should always indicate what that commit does, not a generic name to all.

@guptaprakhariitr guptaprakhariitr changed the title Keys management based on 5 colors updates key_script to store 5 key_holder(colorwise) Feb 23, 2020
# Developer at SDSLabs (@sdslabs)
# Developer at SDSLabs (@sdslabs
# Edit:
# prakhar gupta
Copy link
Contributor

Choose a reason for hiding this comment

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

It is a good practice to write the name in capitals

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

robot.brain.set("keyRed",Key1)
Key1
keyBlue = ()->
Key1 = robot.brain.get("keyBlue") or ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be Key2? @Arnesh07

Copy link
Member Author

Choose a reason for hiding this comment

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

Corrected

scripts/keys.coffee Show resolved Hide resolved
key_holder = keyBlue()
key_holder = user.name
robot.brain.set("keyBlue",key_holder)
else if keyname is 'Yellow'
Copy link
Contributor

Choose a reason for hiding this comment

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

Y should be in small case

Copy link
Member Author

Choose a reason for hiding this comment

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

done

key_holder = keyYellow()
key_holder = user.name
robot.brain.set("keyYellow",key_holder)
else if keyname is 'Green'
Copy link
Contributor

Choose a reason for hiding this comment

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

G should be in small case

Copy link
Member Author

Choose a reason for hiding this comment

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

corrected

else if name is key_holder4
key_holder4 = ""
robot.brain.set("keyGreen",key_holder4)
msg.send "Okay #{name} doesn't have Green keys. Who got the green keys then?"
Copy link
Contributor

Choose a reason for hiding this comment

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

There are a few letter case issues in the code. I am not going to pin point all of them. Go through the code once. G should be capital here. It is a good practice to follow the protocols of standard letter casing.



robot.respond /i have (a key|the key|key|keys)/i, (msg)->
#1this section belongs to "i have keys"
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove "#1", "#2" etc from the start of each comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

@aseem09 done

msg.send "I don't know anyone by the name #{othername}"
key_holder1 = null
robot.brain.set("keyRed",key_holder1)
keyname="Red"
Copy link
Contributor

Choose a reason for hiding this comment

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

Make it a habit of adding a space on both the sides of an operator. eg the = here. There are many such instances in the file which require corrections. Have a look!

# Developer at SDSLabs (@sdslabs)
# Developer at SDSLabs (@sdslabs
# Edit:
# Prakhar Gupta at Mdg
Copy link
Contributor

Choose a reason for hiding this comment

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

Align your name correctly. You may want to copy the same format as that of the author above.

key_holder1 = users.name
robot.brain.set("keyRed",key_holder1)
keyname="red"
else if name is key_holder2 and users.name is not "bro"
Copy link
Contributor

Choose a reason for hiding this comment

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

users.name is not "bro" instead of using this every time make a parent if-else statement which checks for this condition

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.

3 participants