Skip to content

Comments

Added im.open Support#1

Open
nharasym wants to merge 2 commits intostewart:masterfrom
nharasym:master
Open

Added im.open Support#1
nharasym wants to merge 2 commits intostewart:masterfrom
nharasym:master

Conversation

@nharasym
Copy link

Just added a function to send DMs from a bot

stewart added a commit that referenced this pull request Feb 14, 2016
Per #1.

Adds the OpenIM function as a method on slack.Client. This method can be
used to open a new IM between a bot and user, useful if you want your
Slack bot to send messages to a user without having received one first.
@stewart
Copy link
Owner

stewart commented Feb 14, 2016

Hey, @nharasym - sorry for the delay, GitHub doesn't email me when I get
issues/PRs for some reason.

I very much like the idea of this functionality, but not duplicating so much
code to accomplish the task.

After some refactoring, I've added a client.OpenIM method, which can be
used to get start DMs with users. Then you can provide the string it returns as the
channel argument to client.SendMessage, and send messages as usual.

Does that work for you, or is there still missing functionality? I didn't
particularly like the idea of adding a SendDirectMessage method, since it feels to me
like an unnecessary abstraction.

@nharasym
Copy link
Author

Yeah that should work just fine :) I will give it a test later today

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