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

Defaulting for command to request user. #8

Merged
merged 1 commit into from
Oct 4, 2017
Merged

Defaulting for command to request user. #8

merged 1 commit into from
Oct 4, 2017

Conversation

enriquefaci
Copy link

"/tube for me" will show the subscribed lines for the user that types that.

user := slackCommandArgs[0]
var user string = slackCommandArgs[0]
if strings.ToLower(user) == "me" {
user = slackRequest.Username
Copy link
Owner

Choose a reason for hiding this comment

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

it might need an @me since later I remove the @, like fmt.Sprinf("@%s", user)... I'm not sure the username in the slack request contains the @ already. I'll check!

Copy link
Owner

Choose a reason for hiding this comment

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

Docs says the username has no @, so this should be:

if strings.ToLower(user) == "me" {
	user = fmt.Sprintf("@%s", slackRequest.Username)
}

@thoeni thoeni merged commit 79fc5d5 into thoeni:master Oct 4, 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
2 participants