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

Send message to channel by name instead of id? #49

Closed
aspic opened this issue Nov 19, 2015 · 2 comments
Closed

Send message to channel by name instead of id? #49

aspic opened this issue Nov 19, 2015 · 2 comments

Comments

@aspic
Copy link
Contributor

aspic commented Nov 19, 2015

Hi, and thanks for this cool library. I have a small issue sending messages to channels by using name ('#general'). Using the channel id works just fine, but it's kind of tedious to maintain.

The RTM example on https://github.com/nlopes/slack/blob/master/examples/websocket/websocket.go uses #general (alltough it says to replace that name with the channel id). Is this library supposed to work with channel names, or do I have to lookup the channel id by name, when creating the client? Sorry to open a new issue for this.. :-)

@nlopes
Copy link
Collaborator

nlopes commented Nov 26, 2015

Yeah, unfortunately that's what the underlying requests expect. You can always use the info you get back on a ConnectedEvent (https://github.com/nlopes/slack/blob/master/examples/websocket/websocket.go#L26) to map a channel name to a channel id. I try very much to not maintain any state inside the library.

@nlopes nlopes closed this as completed Nov 26, 2015
@aspic
Copy link
Contributor Author

aspic commented Nov 26, 2015

Ah, I didn't know that! Thanks :-) Yeah, understandable :-)

zchee pushed a commit to zchee/slack that referenced this issue Oct 16, 2019
…-types

Built-in return types were mistakenly returned as pointers
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

No branches or pull requests

2 participants