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

Channel info #70

Merged
merged 3 commits into from
Oct 25, 2018
Merged

Channel info #70

merged 3 commits into from
Oct 25, 2018

Conversation

wass3r
Copy link
Collaborator

@wass3r wass3r commented Oct 23, 2018

❤ THANKS FOR HELPING OUT :D

Proposed change

This makes {_channel.name} and {_channel.id} available as variables in your rules.

Types of changes

What types of changes is this pull request introducing to flottbot? Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

You can fill this out after creating your PR. Put an x in the boxes that apply

  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@wass3r wass3r added the enhancement New feature or request label Oct 23, 2018
@coveralls
Copy link

coveralls commented Oct 23, 2018

Pull Request Test Coverage Report for Build 136

  • 0 of 6 (0.0%) changed or added relevant lines in 2 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 37.922%

Changes Missing Coverage Covered Lines Changed/Added Lines %
remote/discord/helper.go 0 3 0.0%
remote/slack/helper.go 0 3 0.0%
Files with Coverage Reduction New Missed Lines %
remote/slack/helper.go 2 0.0%
Totals Coverage Status
Change from base Build 124: -0.2%
Covered Lines: 741
Relevant Lines: 1954

💛 - Coveralls

JordanSussman
JordanSussman previously approved these changes Oct 23, 2018
remote/discord/helper.go Outdated Show resolved Hide resolved
@@ -396,6 +396,10 @@ func populateMessage(message models.Message, msgType models.MessageType, channel
message.ChannelName = name
}

// make channel variables available
message.Vars["_channel.id"] = message.ChannelID
message.Vars["_channel.name"] = message.ChannelName // will be empty if it came via DM

Choose a reason for hiding this comment

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

DM's have a channel ID in Slack, too. Are you sure this wont get populated? It would actually be useful to me if it did.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just _channel.name will be empty, _channel.id will be there

Choose a reason for hiding this comment

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

Ok, I guess that makes sense. Although on the eDiscovery API they have names, too. (based on the participants)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, not familiar with that. There's a story for looking at Conversations API (#46) that might help. Though in a 1:1 conversation, name still seems to be omitted, it seems, according to: https://api.slack.com/methods/conversations.info

Choose a reason for hiding this comment

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

Yeah, I think its fine to have an empty name for DMs. Just an interesting idea.

@wass3r
Copy link
Collaborator Author

wass3r commented Oct 24, 2018

@JordanSussman one more time? i think we resolved everything.

@JordanSussman JordanSussman merged commit 348f7f9 into master Oct 25, 2018
@JordanSussman JordanSussman deleted the channel-info branch October 25, 2018 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants