scrapinghub / slackbot

A chat bot for Slack (https://slack.com).
MIT License
1.26k stars 394 forks source link

Is it possible to send a message without being replied to first? #92

Open csaftoiu opened 8 years ago

csaftoiu commented 8 years ago

Is there any way with the current API to send a message without responding?

If so, how would I do it, and can I request the documentation be updated? (I may update it myself and submit a PR if I figure out how.)

gpailler commented 8 years ago

I have this kind of behavior in AtlassianBot. You can take a look on JiraNotifierBot in https://github.com/gpailler/AtlassianBot/blob/master/plugins/jira.py#L149 The main idea is to retrieve the SlackClient instance, create a thread to monitor something, and send message to the appropriate channel/user...

remik commented 8 years ago

Probably you are looking for message.send('Lorem ipsum')

roperi commented 7 years ago

@remik

That's for the bot to send a message to a channel. Unless I'm wrong I don't see how it is that related with this issue.

lincolnlorscheider commented 7 years ago

I implemented it thusly:

client = slackbot.bot.SlackClient(API_TOKEN)
client.rtm_send_message(client.find_channel_by_name(channel_name), message_string)
Marviel commented 7 years ago

I think @lincolnlorscheider answers this question, so this can be closed.