scrapinghub / slackbot

A chat bot for Slack (https://slack.com).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getting a command with message then sending it to specific channel

RafaelCenzano opened this issue · comments

I was wondering how to make it so I have a command and the bot message a certain example. For example, I message the bot in a direct message or in a specific bot channel and I want it to use that message and put it in the announcements channel.

I think the only way is to access the rtm_send_message in the client

@respond_to('Make Announcement (.*)', re.IGNORECASE)
def make_announcement(message, text):
    message._client.rtm_send_message('GXXXXXXX', text)

Thank you. Was able to get it done with slack webhook.