---
title: "Slack Consolidate: a slackbot built with Python and Supabase"
description: "A Python Slack bot polls watched channels via conversations.history and reposts new messages to consolidated destination channels."
url: "https://swe.quest/articles/slack-consolidate-a-slackbot-built-with-python-and-supabase-0daf5634c032a1a6"
canonical: "https://supabase.com/blog/slack-consolidate-slackbot-to-consolidate-messages"
source: "Supabase"
published: "2022-08-09"
difficulty: "medium"
kind: "How-to"
reading_minutes: 8
tags: ["python","postgres","communications"]
---

# Slack Consolidate: a slackbot built with Python and Supabase

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2022-08-09, 8 min read, How-to. Original: [https://supabase.com/blog/slack-consolidate-slackbot-to-consolidate-messages](https://supabase.com/blog/slack-consolidate-slackbot-to-consolidate-messages)

## Summary

A Python Slack bot polls watched channels via conversations.history and reposts new messages to consolidated destination channels. Supabase Postgres tables hold the channel routing config and act as a dedup buffer. The slack\_watcher table's primary key on (channel\_id, ts, ts\_ms) makes inserts fail for already-seen messages, so only new ones get forwarded. The guide covers the Slack app manifest and OAuth scopes, the table schemas, env setup, and the full polling loop, which uses a 1.4s delay to stay under Slack Tier 3 rate limits and reloads the channel list hourly.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Python](https://swe.quest/tags/python.md) (Languages)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Communications](https://swe.quest/tags/communications.md) (Domains)

## Prerequisites

- Python basics ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))
- Slack API apps
- basic SQL ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))

## Keywords

Supabase, Slack SDK, supabase-py, PostgreSQL, python-dotenv

## Related posts

- [Agentic analytics in Slack with ClickHouse, MCP, and PydanticAI](https://swe.quest/articles/agentic-analytics-in-slack-with-clickhouse-mcp-and-pydanticai-d12acfde3a87c76f.md): ClickHouse · 2025-07-23 · Medium · 8 min read · AI agents, Analytics & OLAP, Python, LLMs
  A Slack bot built with PydanticAI and the Anthropic API answers natural-language analytics questions by querying ClickHouse through the mcp-clickhouse MCP server.
- [Building Slack notifications to monitor pg\_dump and restore workflows](https://swe.quest/articles/building-slack-notifications-to-monitor-pg-dump-and-restore-workflows-da994be4f8b4a40d.md): Neon · 2024-08-01 · Medium · 10 min read · CI/CD, PostgreSQL, Observability, JavaScript
  A nightly GitHub Actions workflow that pg\_dumps an RDS production Postgres database and restores it to a Neon dev branch can be extended to post success and failure alerts to a Slack channel through an incoming webhook.
- [Exploring Support Tooling at Supabase: A Dive into SLA Buddy](https://swe.quest/articles/exploring-support-tooling-at-supabase-a-dive-into-sla-buddy-85261d9d45d8b13f.md): Supabase · 2024-04-25 · Medium · 8 min read · PostgreSQL, Serverless, Scheduling, SQL
  SLA Buddy is Supabase's internal support-ticket SLA enforcer, built almost entirely in Postgres with Edge Functions.
- [Flutter Tutorial: building a Flutter chat app](https://swe.quest/articles/flutter-tutorial-building-a-flutter-chat-app-942d133b45bb7fa6.md): Supabase · 2022-06-30 · Medium · 19 min read · Mobile, Real-time systems, PostgreSQL, Communications
  A real-time single-room chat app can be built with Flutter on the frontend and Supabase as the entire backend, using the supabase\_flutter SDK instead of a custom API.
- [Slack Overflow: How We Scaled Slack to Support 1000s of Developers](https://swe.quest/articles/slack-overflow-how-we-scaled-slack-to-support-1000s-of-developers-8632014eebe803cb.md): Railway · 2025-01-23 · Medium · 9 min read · Communications, Resilience, TypeScript, Product engineering
  Railway built a two-way bridge between Slack Connect channels and its in-house Help Station support tool, auto-creating channels when customers hit growth thresholds.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
