Skip to content

A very simple discord bot that deletes messages from specific channels after a defined amount of time

License

Notifications You must be signed in to change notification settings

open4profit/discord-janitor

 
 

Repository files navigation

Discord Janitor

The Discord Janitor is a small bot that will remove messages older than a configured date from any channel it's added to.

Created for use with Shinobi, to automatically clear motion alert messages from discord after a certain amount of time.

Changelog

CHANGELOG.md

Conventional Commits

Setup & basic usage

  1. Copy the provided .env.dist file to .env

  2. Populate your bot key, and desired message expiration age, change to alternate run frequency as desired

  3. Copy the provided servers.json.dist file to servers.json

  4. Populate the servers.json with an object for each server, and an array of channels on each server to monitor

  5. Install node packages, and run the script:

    yarn install
    yarn start
    

Notes

Ultimately you probably want to run this on a remote server somewhere, and keep it alive with pm2 or similar.

Be aware that it may take a while to remove lots of old messages, or if your server is exceptionally busy this may not work at all as it currently exists.

Commands

!purge n: Purge the most recent n messages. In conjunction with the auto-removal of older messages, this command will allow manual removal of multiple recent messages.

Example: !purge 5 will remove up to 5 recent messages, and the purge command message itself.

About

A very simple discord bot that deletes messages from specific channels after a defined amount of time

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%