I suck at python ~ Bartosz 19/06/2025
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
- 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
- Type
/fdchat @user msgwhereuseris a mention of someone (ping) andmsgis your desired message. It will send a message to the person you mentioned - Type
!msgin existing thread of your channel to have a hidden message which won't be sent to chosen user. - Clicking
Mark as Completedmarks the thread as completed and puts a checkmark as a reaction. - Clicking
Delete threaddeletes 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.
Create a Slack App with these scopes:
Bot token scopes
channels:historychannels:readchat:writechat:write.customizechat:write.publiccommandsfiles:readfiles:writegroups:historyim:historyim:readim:writereactions:readreactions:writeusers:read
User scopes
channels:historychannels:readchannels:writechat:writeim:historyim:readusers: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.
You need to create a database on Airtable.
You need to have at least two tables.
Active ThreadsCompleted Threads
They have to include these fields:
Active Threads
user_id- single line textchannel- single line textcreated_at- created timelast_activity- last modified timemessage_ts- single line textthread_ts- single line textfunny_field- single line text
Completed Threads
user_id- single line textchannel- single line textcompleted_at- created timemessage_ts- single line textthread_ts- single line text
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
# 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
