slackgpt

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

README

slackgpt

GitHub go.mod Go version GitHub Workflow Status Issues

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

Build the binary, add tokens to config, and run!

Build

# 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.

CGPT_API_KEY=sk-...z7
SLACK_APP_TOKEN=xapp-1-...47
SLACK_BOT_TOKEN=xoxb-...S0

Run

Help
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

DMS

Threads

Conversation in threads

Threads

Contributing

Please follow the Contribution File 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. 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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package config handles all the configuration
Package config handles all the configuration
src
slack
Package slackhandler handles slack appMention events and responds with chat-gpt response
Package slackhandler handles slack appMention events and responds with chat-gpt response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL