scrapinghub / slackbot

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

getting a command with message then sending it to specific channel #184

Closed RafaelCenzano closed 5 years ago

RafaelCenzano commented 5 years ago

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.

kiaka010 commented 5 years ago

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)
RafaelCenzano commented 5 years ago

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