SuperAGI icon indicating copy to clipboard operation
SuperAGI copied to clipboard

Added Slack Tool

Open Arkajit-Datta opened this issue 2 years ago • 6 comments

The slack tool was added with a few basic Features as of now -

  1. Send Messages: Messages can be sent to groups and individuals directly.
  2. Read Messages: Messages can be retrieved from channels, right now a basic retrieved dictionary is constructed which can be improved further in the future.

Subsequent changes were made in requirements, config.yaml, and test.py. Testing code was added in order to review the working of the tool.

Setting up the Slackbot:

  1. Create a Slack App by going to - https://api.slack.com/apps
  2. Select from Scratch
  3. Select the Workspace in which you want to install the bot
  4. Now, navigate to Features > Oauth and Permissions, and add scopes under the Bot Token Scopes. I'll recommend adding all the scopes from the drop-down (for Dev purposes). This can be further optimized to select only the modules we need.
  5. Then scroll up to install the app in the workspace.
  6. Doing this you should be getting a bot token which we need further in the config.yaml
  7. Note: Make sure the bot is part of the groups you want to retrieve the messages from. Consider adding the bot in the groups you want to scrape the data from.

A detailed README should be added in the future. I'll try to do that after the dev is approved.

Arkajit-Datta avatar May 29 '23 20:05 Arkajit-Datta

What are the exact scopes need to be added for this usecase?

Autocop-Agent avatar May 31 '23 07:05 Autocop-Agent

Hey @Autocop-Agent so i did add all the read write scope permissions. I will have to do a certain trial and error to see exactly what to add and what not to.

Arkajit-Datta avatar May 31 '23 07:05 Arkajit-Datta

We have to be sure about the scopes for this usecase, as there are lot of them and someone who is running this tool, will only be keen to add the required ones which is deemed useful

Autocop-Agent avatar May 31 '23 08:05 Autocop-Agent

I will test it out

Autocop-Agent avatar May 31 '23 08:05 Autocop-Agent

That's true, lemme also try making a list of scopes needed, this can go into the README as well.

Arkajit-Datta avatar May 31 '23 11:05 Arkajit-Datta

hey @Autocop-Agent were you able to test out the code? Lemme know if any changes are required

Arkajit-Datta avatar Jun 04 '23 19:06 Arkajit-Datta

Hey, @TransformerOptimus I have resolved the conflicts, please have a look! Thanks!

Arkajit-Datta avatar Jun 07 '23 18:06 Arkajit-Datta

I was testing this tool. I could able to get the send messages working but unable to get the read messages woeking.

TransformerOptimus avatar Jun 08 '23 01:06 TransformerOptimus

Can you share the error you got while using the ReadMessages, 2 things we have to keep in mind that the bot we have configured has to be a part of the group from where we are trying to fetch/ read messages. Secondly, we must ensure all the permissions(Scopes) are proper.

Arkajit-Datta avatar Jun 08 '23 09:06 Arkajit-Datta

Can you share the error you got while using the ReadMessages, 2 things we have to keep in mind that the bot we have configured has to be a part of the group from where we are trying to fetch/ read messages. Secondly, we must ensure all the permissions(Scopes) are proper.

The server responded with: {'ok': False, 'error': 'channel_not_found'}

TransformerOptimus avatar Jun 08 '23 10:06 TransformerOptimus

we can push the send slack as it is simple to setup and configure. Can we push send message and we can extend it later.

TransformerOptimus avatar Jun 08 '23 10:06 TransformerOptimus

The server responded with: {'ok': False, 'error': 'channel_not_found'}

So that will be the case where the slack bot was not added to the group from which you were trying to read the messages. This can be easily resolved with adding the slack bot to that group.

Arkajit-Datta avatar Jun 08 '23 10:06 Arkajit-Datta

we can push the send slack as it is simple to setup and configure. Can we push send message and we can extend it later.

Yeah sure! also, I'm open to making any further changes if you want...

Arkajit-Datta avatar Jun 08 '23 10:06 Arkajit-Datta

Thanks Arkajit. Merging the changes.

TransformerOptimus avatar Jun 08 '23 10:06 TransformerOptimus

Thanks @TransformerOptimus. Please let me know how we can proceed on the Slack Tool and what are the next requirements on the same.

Arkajit-Datta avatar Jun 08 '23 11:06 Arkajit-Datta

Hi @Arkajit-Datta can you write a Readme for this tool?

neelayan7 avatar Jun 19 '23 11:06 neelayan7

sure @neelayan7. will take that up!

Arkajit-Datta avatar Jun 19 '23 11:06 Arkajit-Datta