• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
morgante

morgante

slack-friendly

Public
Like
1
slack-friendly
Home
Code
2
README.md
H
slack-webhook.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
slack-webhook.ts
https://morgante--5e1fc510691511f0ae850224a6c84d84.web.val.run
README.md

Slack Friendly Reminder Bot

A simple Slack app that monitors your messages and sends you a private reminder when you end messages with a period, encouraging you to be more friendly in your communication.

Features

  • Monitors only messages from the app owner (you)
  • Detects messages ending with periods
  • Sends private DM reminders with friendly suggestions
  • Ignores bot messages, edits, and very short messages

Setup Instructions

1. Create a Slack App

  1. Go to Slack API and click "Create New App"
  2. Choose "From scratch"
  3. Give it a name like "Friendly Reminder Bot"
  4. Select your workspace

2. Configure Bot Permissions

In your Slack app settings:

  1. Go to "OAuth & Permissions"
  2. Add these Bot Token Scopes:
    • chat:write - To send messages
    • channels:history - To read channel messages
    • groups:history - To read private channel messages
    • im:history - To read direct messages
    • mpim:history - To read group direct messages

3. Install the App

  1. In "OAuth & Permissions", click "Install to Workspace"
  2. Authorize the app
  3. Copy the "Bot User OAuth Token" (starts with xoxb-)

4. Set Environment Variables

In Val Town, set these environment variables:

  • SLACK_BOT_TOKEN: Your bot token from step 3
  • SLACK_OWNER_USER_ID: Your Slack user ID (see instructions below)

Finding Your Slack User ID

  1. In Slack, click on your profile picture
  2. Click "Profile"
  3. Click the three dots menu
  4. Click "Copy member ID"

5. Configure Event Subscriptions

  1. In your Slack app settings, go to "Event Subscriptions"
  2. Enable events
  3. Set the Request URL to your Val Town webhook URL: https://[your-username]-slackwebhook.web.val.run
  4. Under "Subscribe to bot events", add:
    • message.channels - Messages in public channels
    • message.groups - Messages in private channels
    • message.im - Direct messages
    • message.mpim - Group direct messages
  5. Save changes

6. Reinstall the App

After adding event subscriptions, you'll need to reinstall the app to your workspace with the new permissions.

How It Works

  1. Slack sends webhook events to the Val Town endpoint
  2. The webhook filters for messages from you (the owner)
  3. If a message ends with a period, it sends you a private DM reminder
  4. The reminder suggests using friendlier punctuation like ! or 😊

Testing

Send a message in any channel that ends with a period, like:

This is a test message.

You should receive a private DM from the bot with a friendly reminder!

Privacy

  • Only processes messages from the configured owner user ID
  • Ignores all other users' messages
  • Sends reminders only as private DMs to the owner
HTTP
  • slack-webhook.ts
    morgante--5e…84.web.val.run
Code
README.md
H
slack-webhook.ts
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.