tamaq2048 / slack-summarizer

OpenAI's ChatGPT API to create and post a summary of a Slack public channel.
1 stars 0 forks source link

Script for summarizing Slack public channels using ChatGPT

日本語はこちら

by masuidrive @ Bloom&Co., Inc. 2023- APACHE LICENSE, 2.0

This script uses OpenAI's ChatGPT API to create and post a summary of a Slack public channel.

In organizations where the number of channels is increasing, it can be difficult to keep up with reading all the activity. By creating and posting summaries, it is easier to keep track of channel activity.

Most of this code was written using ChatGPT. If you have any better prompts or feature enhancements, please submit a Pull Request.

Please check OpenAI's terms and conditions of information handling for yourself, including the following

https://platform.openai.com/docs/data-usage-policies

If you have any questions, please feel free to contact me on http://twitter.com/masuidrive_en or http://twitter.com/masuidrive.

How to set it up on GitHub Actions

It runs on GitHub Actions every day at 5:00 a.m., so if you want to run it in a different environment, you'll have to figure it out.

Fork it to your own GitHub account

Edit running time

Set environment variables

OPEN_AI_TOKEN

SLACK_BOT_TOKEN

{"display_information":{"name":"Summary","description":"Public channelのサマリーを作る","background_color":"#d45f00"},"features":{"bot_user":{"display_name":"Summary","always_online":false}},"oauth_config":{"scopes":{"bot":["channels:history","channels:join","channels:read","chat:write","users:read"]}},"settings":{"org_deploy_enabled":true,"socket_mode_enabled":false,"token_rotation_enabled":false}}

SLACK_POST_CHANNEL_ID

LANGUAGE

TIMEZONE

Install the bot in the channel

Run

With these settings, a summary of Slack's public channels will be posted every day at 5:00 a.m.

you would manually execute it by opening the "Actions" tab, clicking on "Summary" on the left, and clicking "Run workflow" on the right.