GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - slamcore/random-coffee: A friendly Slack bot that automatically pairs team members for casual coffee chats

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
src/random_coffee
src/random_coffee
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
README.md
README.md
 
 
docker-compose.yml
docker-compose.yml
 
 
pyproject.toml
pyproject.toml
 
 
uv.lock
uv.lock
 
 

Repository files navigation

RandomCoffee

A friendly Slack bot that automatically pairs team members for casual coffee chats every Tuesday. Perfect for building team connections and fostering a collaborative culture! ā˜•

Features

  • šŸ¤– Auto-Filtering: Ignores bots and admin users
  • šŸ’¬ Friendly Messages: Sends warm, pressure-free notifications about pairings
  • ā° Scheduled: Runs every Tuesday at a configurable time (default: 09:00 UTC)
  • šŸ“… Wednesday Suggestion: Encourages meetups the day after pairing
  • 🚨 Error Notifications: Automatically notifies admin of any issues via Slack DM
  • šŸ“ Logging: Comprehensive logging to both file and console

Installation

Using Docker (Recommended)

docker compose up -d --remove-orphans --force-recreate --build

Manual Installation

# Install dependencies
pip install slack-sdk schedule

# Run the bot
python src/gpusentry/main.py --token "xoxb-your-token" --channel "#random-coffee"

Configuration

Option 1: Configuration File

Create a JSON configuration file (default: /etc/random_coffee/config.json):

{
  "slack_token": "xoxb-your-slack-token"
}

Then run:

python main.py --config /etc/random_coffee/config.json

Option 2: Environment Variable

export SLACK_BOT_TOKEN="xoxb-your-token-here"
python main.py --channel "#random-coffee"

Option 3: Command Line Arguments

python main.py --token "xoxb-your-token" --channel "#random-coffee" --time "09:00"

Command Line Options

--token, -t       Slack Bot OAuth Token (starts with xoxb-)
--channel, -c     Slack channel for pairings (default: #random-coffee)
--time            Daily pairing time in HH:MM format, 24-hour UTC (default: 09:00)
--config          Path to JSON configuration file (default: /etc/random_coffee/config.json)

Setting Up the Slack Bot

  1. Create a Slack App

    • Go to https://api.slack.com/apps
    • Click "Create New App" → "From scratch"
    • Name it "Random Coffee Bot" and select your workspace
  2. Add Bot Scopes

    • Go to "OAuth & Permissions"
    • Add these scopes under "Bot Token Scopes":
      • channels:read - View basic channel info
      • chat:write - Send messages
      • users:read - View workspace members
      • groups:read - Access private channels (optional)
  3. Install to Workspace

    • Click "Install to Workspace"
    • Authorize the app
    • Copy the "Bot User OAuth Token" (starts with xoxb-)
  4. Invite Bot to Channel

    • In Slack, go to your channel (e.g., #random-coffee)
    • Type: /invite @Random Coffee Bot
  5. Configure Error Notifications

    • Update DEFAULT_ERROR_RECIPIENT in the code to your Slack username (default: @dchebakov)

Usage

Once running, the bot will:

  1. Automatically run every Tuesday at the configured time (UTC)
  2. Fetch all human members from the specified channel (excluding bots and admin)
  3. Randomly shuffle and pair members
  4. Send a friendly announcement message with the pairings
  5. Suggest Wednesday as an optional day for coffee chats

Example Output

ā˜• Happy Tuesday, Coffee Lovers! ā˜•
It's time for our weekly Random Coffee pairings! šŸŽ‰

Here are this week's wonderful pairings:

1. @Alice & @Bob ā˜•
2. @Charlie & @Diana ā˜•
3. @Eve, @Frank & @Grace ā˜• (trio!)

✨ Here's the idea: ✨
Tomorrow (Wednesday) would be a lovely day for a coffee chat!
It's totally optional and there's no pressure at all. šŸ’›

šŸ“… Feel free to schedule a quick 15-30 minute call whenever works best for both of you.
šŸ’¬ Chat about anything - hobbies, weekend plans, fun projects, or just say hi!
šŸ¤ If this week doesn't work out, no worries! There's always next Tuesday.

Have a wonderful week, everyone! 🌟

Logs

Logs are written to:

  • File: random_coffee.log in the working directory
  • Console: Standard output with timestamps

Troubleshooting

Bot not sending messages

  • Ensure the bot has chat:write permission
  • Verify the bot is invited to the channel: /invite @BotName

"not_in_channel" error

  • Invite the bot to your channel using /invite @YourBotName

Authentication failed

  • Check your token starts with xoxb-
  • Regenerate token if needed in Slack App settings

No members found

  • Verify the channel name is correct (with or without #)
  • Ensure bot has channels:read and users:read permissions

Error notifications not working

  • Update DEFAULT_ERROR_RECIPIENT to a valid Slack username
  • Ensure the user exists in your workspace

License

MIT License

About

A friendly Slack bot that automatically pairs team members for casual coffee chats

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Ɨ600. No cookies required.