Sanitizer is a simple bot that uses regex to identify links for social platforms and replaces them with discord embed friendly links that allows you to view the content of the link without ever having to leave the discord app. You might think this is a bot for lazy people, but I assure you, if you give it a try, you'll never want to go back.
The bot is developed in Python using the interactions.py
library. Click here for their GitHub repo. This GitHub repo is utilized for version control and the assistance of GitHub Copilot has been used for creating examples of implementation from documentations.
- Add Reddit Support
- Add a config panel
- User Privacy first: No logs are made on any messages users send.
- Supports Multiple platforms: Currently works with Twitter, TikTok, Instagram. More to come!
- Automatic conversion: Automatically fixes any supported links posted.
- User Installable App: The
/sanitize
app command can be used anywhere. - Handles Direct Messages: Will attempt to fix links sent in private.
- Implemented QuickVids API: Implemented QuickVids API to convert TikTok links into embeddable content in discord.
If you wish to host your own instance of the Sanitizer bot, follow along.
- Python 3.12 or higher
- A Discord account
-
Clone the repository:
git clone https://github.com/suhaybu/sanitizer-bot.git
-
Setup virtual Python environment:
python3 -m venv .venv
-
Activate virtual Python environment: on Linux or MacOS
source .venv/bin/activate
on Windows
.venv\Scripts\activate
-
Install the required packages:
pip install -r requirements.txt
-
Set up your Bot Token: Add your Discord bot token to the
.env
file present in the root directory. -
Set up your QuickVids Token (for TikTok): Get your QuickVids api token from here.
To run the bot, use the following command:
python3 main.py
Once the bot is running, you can use the following commands:
/credits
: To roll the credits-
`/sanitize`: To fix the embed of your link
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the CCO License. See LICENSE
for more information.
Suhayb - @suhayb_u
Project Link: https://github.com/suhaybu/sanitizer-bot
- interactions.py
- Twitter: Thanks to FixTweet's awesome FxTwitter project
- TikTok: Thanks to QuickVids super fast API
- Instagram: Thanks to InstaFix's reliable service