Skip to main content

Cleans messages from a discord channel older than a set time in days

Project description

DiscordMessageCleaner

PyPI version GitHub Sponsorship

Cleans messages from a Discord channel and its threads when they are older than a set time in days. Threads left empty after cleanup are deleted.

Setup

pip install discord-message-cleaner

🚀 Setting Up & Inviting DeleteBot

  1. Create a Discord Application

  2. Add a Bot User

    • In your application sidebar, select BotAdd BotYes, do it.
    • Under Privileged Gateway Intents, enable Message Content Intent.
  3. Generate an Invite Link

    • In the sidebar, go to OAuth2URL Generator.
    • Under Scopes, check: bot
    • Under Bot Permissions, check at minimum:
      • Read Message History
      • Manage Messages
      • Manage Threads (required to delete empty threads and access archived private threads)
    • Copy the generated URL at the bottom.
  4. Invite to Your Server

    • Paste the URL into your browser, select your server, and authorize.

Run

discord_message_cleaner
  --token=<your_discord_bot_token>
  --channel_id=<your_discord_channel_id>
  --days=<number_of_days>

Docker

docker run -d \
  --name="DiscordMessageCleaner" \
  -e 'TOKEN=<your_discord_bot_token>'
  -e 'CHANNEL_ID=<your_discord_channel_id>'
  -e 'DAYS=<number_of_days>'
  rix1337/docker-discord-message-cleaner:latest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discord_message_cleaner-0.1.2.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

discord_message_cleaner-0.1.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file discord_message_cleaner-0.1.2.tar.gz.

File metadata

  • Download URL: discord_message_cleaner-0.1.2.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for discord_message_cleaner-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f750d1faf66246d1475f2883d9ec673398cbcb44f1f82c4b97277326a24373e9
MD5 5f2e3c0a26c72337bec9abe002ed0882
BLAKE2b-256 674d0d001a87b543832166519a00982c58c3c17844f929ba2525a92f2137b952

See more details on using hashes here.

File details

Details for the file discord_message_cleaner-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for discord_message_cleaner-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2538786be16f3daa6a84e991dc0b9e38f3323d22301cade81aea3ca154bef528
MD5 031b4101aed8f631f3c9c96d1b01b97d
BLAKE2b-256 b521e27d16a4eef278a2b841e97a7326ddfe13240688b392646ce9fb3f2c5424

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page