SuperAGI
SuperAGI copied to clipboard
Added Slack Tool
The slack tool was added with a few basic Features as of now -
- Send Messages: Messages can be sent to groups and individuals directly.
- 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:
- Create a Slack App by going to - https://api.slack.com/apps
- Select from Scratch
- Select the Workspace in which you want to install the bot
- 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.
- Then scroll up to install the app in the workspace.
- Doing this you should be getting a bot token which we need further in the config.yaml
- 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.
What are the exact scopes need to be added for this usecase?
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.
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
I will test it out
That's true, lemme also try making a list of scopes needed, this can go into the README as well.
hey @Autocop-Agent were you able to test out the code? Lemme know if any changes are required
Hey, @TransformerOptimus I have resolved the conflicts, please have a look! Thanks!
I was testing this tool. I could able to get the send messages working but unable to get the read messages woeking.
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.
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'}
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.
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.
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...
Thanks Arkajit. Merging the changes.
Thanks @TransformerOptimus. Please let me know how we can proceed on the Slack Tool and what are the next requirements on the same.
Hi @Arkajit-Datta can you write a Readme for this tool?
sure @neelayan7. will take that up!