Slack

How to get your bot token

Create app with the link below

Then go to OAuth & Permissions

Screenshot slack

Add scope to your app to allow bot to speak chat:write.public

Screenshot rights

Then you sould reload your app, slack should notify you like this

Screenshot token

Copy the Bot user OAuth Access Token and use it in the connect below

Send message

import naas_drivers
token = "xoxb-***-***-****"
message = "Hello friends"
result = naas_drivers.slack.connect(token).send(message)

Image

Image be url only, if you need expose asset before sending it

import naas_drivers
token = "xoxb-***-***-****"
message = "Hello friends"
image = "http://i.imgur.com/c4jt321l.png")
result = naas_drivers.slack.connect(token).send(message, image=image)