0

By using Oauth2 token

I want to send some data from Google Sheets by using Slackbot. I've done everything, tokens connections etc. however I still have to add channel id to my script manually. So I want to build something when the bot invited to channel, it works by itself properly without adding channel id manually.

Tarık
  • 1
  • 1

1 Answers1

0

You can try the Events API: https://api.slack.com/apis/connections/events-api

Check the basic setup, you'll need to provide a URL to where slack will send the events you subscribe.

The event you are probably looking for is member_joined_channel You will receive an event everytime a user joins the channel(including your own bot), so you would need to verify the userId, see if it's your bot, otherwise simply ack the event without further processing it.

Hope that helps.

Vinicius Souza
  • 151
  • 2
  • 11