/clearurls-discord-bot

A Discord bot that uses ClearURLs to automatically strip out tracking parameters from messages with links.

Primary LanguagePythonMIT LicenseMIT

ClearURLs Discord Bot

Have you ever noticed those utm and fbclid snippets in links? Those are used to track your activity and unnecessary for the site to work. This bot uses the Unalix library that is based off of the popular ClearURLs browser extension to automatically strip out such parameters from links. This keeps URLs short and readable while enhancing the privacy of your server's members.

demo.png

This version doesn't have a hosted instance, but you can host it yourself. See Self-Hosting for instructions.

Permissions

The bot's permissions system is designed to be granular, minimal, and gracefully degrade in the absence of those unnecessary for basic function.

  • Read Messages and Send Messages are required to perform the cleaning.
  • Manage Messages is recommended so the bot can suppress embeds on its own links to reduce visual clutter.
  • Read Message History and Add Reactions are optional for the original poster to easily delete the bot's replies with the :wastebasket: emoji. Note that these two permissions are on by default for @everyone. If you want to disable react-to-remove, turn off these permissions for @everyone and give every human in your server a new role. This functionality also requires Manage Messages for deletion.

Self-Hosting

It is very straightforward to host this yourself. If you do, I would love to know!

  1. Download the repository with git clone https://github.com/DanielZTing/clearurls-discord-bot
  2. Get dependencies with pip install -r requirements.txt
  3. Set up a new application at the Discord Developer Portal
  4. Add a bot and check the bot scope and the above permissions in the OAuth2 tab
  5. Visit the generated link to invite the bot
  6. Copy the token from the Bot tab and paste TOKEN=[your clipboard here] into a file named .env
  7. Run with python main.py

Docker container

After getting the developer token (see Self-Hosting) run:

docker run -e TOKEN=your-bot-token rutkai/clearurls-discord-bot:latest

Privacy Policy

I collect zero information.