Skip to content

hackclub/certpheus

 
 

Repository files navigation

I suck at python ~ Bartosz 19/06/2025

Fraudpheus

Origin

So... it's named Fraudpheus cause its main purpose was to communicate with people who are accused of committing fraud in Summer of Making program made by Hack Club.

We were receiving lots of DMs, and even emails from angry people, some were searching other ways to reach us by finding our social medias.
To make it more private and safer for us, I've created a bot which keeps our identities hidden

Features

  • Communicating between people who DM your bot and members of certain channel
  • Ability of your team to take notes by typing ! at the start of reply - message won't be sent as DM that way, it will remain in the channel.
  • Keeping track of which cases are resolved and which not by marking threads as completed
  • Deleting threads to keep the channel clean
  • Transferring files between channel members and people DMing the bot

Usage

  • Type /fdchat @user msg where user is a mention of someone (ping) and msg is your desired message. It will send a message to the person you mentioned
  • Type !msg in existing thread of your channel to have a hidden message which won't be sent to chosen user.
  • Clicking Mark as Completed marks the thread as completed and puts a checkmark as a reaction.
  • Clicking Delete thread deletes the thread both from the channel and from the db.
  • New messages started by users DMing your bot, or answering to completed threads will appear as a new thread.

Setup

Slack App

Create a Slack App with these scopes:

Bot token scopes

  • channels:history
  • channels:read
  • chat:write
  • chat:write.customize
  • chat:write.public
  • commands
  • files:read
  • files:write
  • groups:history
  • im:history
  • im:read
  • im:write
  • reactions:read
  • reactions:write
  • users:read

User scopes

  • channels:history
  • channels:read
  • channels:write
  • chat:write
  • im:history
  • im:read
  • users:read

Add a slash command, initial one is fdchat, you can change it in code though.
Make sure to turn the option Escape channels, users, and links sent to your app on.

Airtable

You need to create a database on Airtable.
You need to have at least two tables.

  • Active Threads
  • Completed Threads

They have to include these fields:

Active Threads

  • user_id - single line text
  • channel - single line text
  • created_at - created time
  • last_activity - last modified time
  • message_ts - single line text
  • thread_ts - single line text
  • funny_field - single line text

Completed Threads

  • user_id - single line text
  • channel - single line text
  • completed_at - created time
  • message_ts - single line text
  • thread_ts - single line text

env

Create a .env file in the roof directory of this project (outside of src/)
Fill it out based on example.env file
User token is used for deleting messages of other users, as only admins can do that. If you don't have admin privileges, fill it - but keep in mind your bot won't delete all messages when destroying threads

Preparing python stuff

# Create virtual environment
python3 -m venv venv

# Activate it
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

After that your bot should be ready to run!
Just remember to add that bot to the channel

About

Bot to communicate with people and staff members on Slack

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.9%
  • Dockerfile 2.1%