I created a ChatGPT Slack bot using Slack's next-generation platform, which is in beta as of 2023. When you mention the bot, it calls the ChatGPT API and provides a response.
While many people have created bots with similar functionality, and you can find code on github.com, the one I made has the following features. Mine is the best!
- You can add the bot to any channel later, not just the channel specified with fixed values in the file.
- By saving conversation history in Slack Datastores, you can send a complete series of conversations to the ChatGPT API, allowing it to understand the context and respond appropriately.
- You can set the system message passed to the ChatGPT API for each channel where the bot operates, and you can change it later.