https://github.com/drkennetz/slackgpt
slack bot written in go that processes DM's / app mentions and replies with chat-gpt's response
https://github.com/drkennetz/slackgpt
bot chatgpt chatgpt-api go golang openai slack
Last synced: 5 months ago
JSON representation
slack bot written in go that processes DM's / app mentions and replies with chat-gpt's response
- Host: GitHub
- URL: https://github.com/drkennetz/slackgpt
- Owner: drkennetz
- License: apache-2.0
- Created: 2023-01-18T21:51:31.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-02T01:19:21.000Z (about 3 years ago)
- Last Synced: 2023-06-27T23:08:29.211Z (almost 3 years ago)
- Topics: bot, chatgpt, chatgpt-api, go, golang, openai, slack
- Language: Go
- Homepage:
- Size: 10.2 MB
- Stars: 12
- Watchers: 4
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
slackgpt
slackgpt is a simple slack bot server which handles DM's and app mention events, sending the event to chat-gpt and responding to the channel with chat-gpt's response.
slackgpt can respond to both direct messages, or threads in a channel. It can handle multiple conversations concurrently, enabling parallel conversations to happen simultaneously in channels it has been added to.
## Table of Contents
- [Quick Start](#Quick-Start)
- [Bot Setup](./example/walkthrough.md)
- [DM Example](#DMS)
- [Thread Example](#Threads)
- [Contributing](#Contributing)
- [Open an Issue](#Issues)
- [Code of Conduct](#Code-of-Conduct)
## Quick Start
Build the binary, add tokens to config, and run!
### Build
```bash
# requires >= go 1.18 to build from source
git clone https://github.com/drkennetz/slackgpt.git
cd slackgpt && go build -o ./bin/slackgpt
```
### Config
For a more thorough walk-through of setting up the bot and getting tokens, visit [this detailed doc](./example/walkthrough.md).
```
CGPT_API_KEY=sk-...z7
SLACK_APP_TOKEN=xapp-1-...47
SLACK_BOT_TOKEN=xoxb-...S0
```
### Run
#### Help
```bash
This program is a slack bot that sends mentions to chat-gpt and responds with chat-gpt result
VERSION: development
Usage: slackgpt --config CONFIG [--type TYPE] [--debug]
Options:
--config CONFIG, -c CONFIG
config file with slack app+bot tokens, chat-gpt API token
--type TYPE, -t TYPE the config type [json, toml, yaml, hcl, ini, env, properties]; if not passed, inferred from file ext
--debug set debug mode for client logging
--help, -h display this help and exit
--version display version and exit
```
#### Run
```
./bin/slackgpt -c ./config.env [-t config type] [--debug]
2023/02/01 14:53:19 Config values parsed
socketmode: 2023/02/01 14:53:19 socket_mode_managed_conn.go:258: Starting SocketMode
2023/02/01 14:53:19 Connecting to Slack with Socket Mode...
...
```
## DMS
Conversation in DM's

## Threads
Conversation in threads

## Slack Commands
| **Command** | **Description** | **Usage Example** |
|---|---|---|
| clear convo | clear conversation of thread where command is called | '@slackgpt clear convo' |
## Contributing
Please follow the [Contribution File](./Contribution.md) to contribute to this repo.
## Issues
To submit an issue, select the issue template that most closely
corresponds with your issue type and submit. Someone will get to you soon!
## Code of Conduct
Please note that slackgpt has a [Code of Conduct](./CODE_OF_CONDUCT.md).
By participating in this community, you agree to abide by its rules.
Failure to abide will result in warning and potentially expulsion from this community.