Skip to content

okcojo/slack-reaction-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slack Reaction Counter

A Deno application that monitors Slack message reactions in a specific channel and summarizes them in a Notion database.

Features

  • Monitors reactions on messages in a specified Slack channel
  • Summarizes reaction data and stores it in Notion
  • Supports both one-time runs and scheduled monitoring
  • Automatically updates existing entries or creates new ones

Setup

Prerequisites

  • Deno runtime installed
  • Slack app with appropriate permissions
  • Notion integration with database access

Configuration

  1. Copy .env.example to .env:
cp .env.example .env
  1. Fill in your credentials in .env:
    • SLACK_BOT_TOKEN: Your Slack bot token (starts with xoxb-)
    • SLACK_APP_TOKEN: Your Slack app token (starts with xapp-)
    • NOTION_TOKEN: Your Notion integration token
    • NOTION_DATABASE_ID: The ID of your Notion database
    • SLACK_CHANNEL_ID: The Slack channel ID to monitor

Slack App Setup

  1. Create a new Slack app at https://api.slack.com/apps
  2. Add the following OAuth scopes:
    • channels:history
    • reactions:read
  3. Install the app to your workspace
  4. Add the bot to the channel you want to monitor

Notion Database Setup

Create a Notion database with the following properties:

  • Message ID (Title)
  • Message Text (Text)
  • Author (Text)
  • Channel ID (Text)
  • Total Reactions (Number)
  • Reactions (Text)
  • Timestamp (Text)

Usage

One-time run:

deno task start

Scheduled monitoring (runs every 15 minutes):

deno run --allow-net --allow-env --allow-read --allow-write --allow-sys src/main.ts --schedule

Development:

deno task dev

How it works

  1. Connects to Slack API and fetches recent messages from the specified channel
  2. Identifies messages that have reactions
  3. Counts and summarizes reactions for each message
  4. Updates or creates entries in the Notion database
  5. Sorts messages by total reaction count (most reacted first)

The application handles both creating new entries and updating existing ones based on the message ID.

About

counts messages' reactions and sync to notion database. Also, my experiment with claude code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •