Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoDelete

A plugin for Discord that puts a timer on the messages you send. After the time you set runs out, each message deletes itself. A small countdown sits under every message that is waiting, and a Keep button cancels it if you change your mind.

You set the timer per channel, per category, or per server. Nothing is deleted anywhere you have not asked for.

What you need before you start

This is a Vencord userplugin. Vencord is a client mod: extra code that runs inside the normal Discord desktop app and adds features to it. Plugins like this one are not downloaded from a store, they are compiled into Vencord.

That means the ready made Vencord installer cannot load this plugin. You need a copy of Vencord that you built yourself. If you have not done that before, follow Vencord's own guide first and come back when Discord is running your own build:

Installing Vencord from source

You will end up with a Vencord folder on your computer. Everything below happens inside that folder.

Installing

Open a terminal in the root of your Vencord folder, the one that contains src and package.json, and make sure you have already run pnpm install there once.

Then run these three commands:

git clone https://github.com/KernelSpecter/AutoDelete src/userplugins/autoDelete
pnpm build
pnpm inject

What each one does:

  1. git clone puts the plugin where Vencord looks for user plugins.
  2. pnpm build compiles Vencord together with the plugin.
  3. pnpm inject points your Discord app at that build. You only need this the first time. After that, pnpm build alone is enough.

Now restart Discord, open Settings > Plugins, search for AutoDelete, and turn it on.

To update later, run git pull inside src/userplugins/autoDelete and then pnpm build again.

Turning it on changes nothing yet

This is on purpose. Out of the box the plugin is set to only where I set a rule, so enabling it does not start deleting anything. You have to point it at a place first.

Two ways to do that:

  • Right click a channel in the sidebar and choose Auto-delete here.
  • Or type a command in the channel: /autodelete here 10m

If you want to watch it work without it deleting anything yet, turn on dry run in the plugin settings. The countdown still appears and says would delete, and nothing is actually removed. This is the safest way to get used to it.

Timers are written the way you would say them: 45s, 10m, 1h 30m, 2 days. A plain number means seconds. The shortest allowed is 3 seconds and the longest is 14 days.

Which timer applies where

You can set rules at several levels. The most specific one always wins.

Rule set on Overrides
A single channel everything below it
The channel's category the server rule and the default
A whole server the default
The scope setting and default timer nothing, this is the fallback

Setting a place to off here is different from having no rule at all. Off here means "never delete anything here", and it cannot be overridden by anything, including the reply and reaction triggers below. Having no rule just means the general scope setting decides.

What stops a message from being deleted

  • Any message containing !keep is never given a timer. Adding !keep to a message that is already counting down cancels it.
  • Pinned messages are left alone. If you pin a message that is already counting down, it is spared.
  • The Keep button, either in the bar that appears when you hover a message or in its right click menu. This works any time before the countdown reaches zero.
  • Messages you attached a file to, if you switch that option on.

The countdown turns red for the last ten seconds, which is the point of showing it at all.

Deleting early on a reply or a reaction

Two extra triggers can delete a message sooner. Both are off by default, and both only work in places where a timer already applies, so the rules you set stay in charge.

  • On reply. Someone replies to your message. How much goes with it is up to the chain mode setting: only that one message, the run of messages it belongs to, or the reply thread it is part of. Never more than 25 messages either way.
  • On reaction. Your message collects reactions from other people, up to a number you choose. Your own reactions are not counted.

Commands

Command What it does
/autodelete Shows what is happening here and overall
/autodelete here <timer> Sets a timer for this channel. off to protect it, clear to remove the rule
/autodelete server <timer> Sets a timer for the whole server
/autodelete rules Lists every rule you have set
/autodelete arm on|off Stops new messages being scheduled, without losing your rules

Settings worth understanding

Setting Default Why it is there
Jitter 10% Adds a little random time after your timer, so a group of messages does not disappear all at once. It never deletes anything early
Minimum interval 1200 ms The smallest gap between two deletions. Messages are removed one at a time, never in parallel
Max queue age 7 days If a timer ran out while Discord was closed for longer than this, the message is forgotten rather than deleted
Dry run off Reports what it would delete and deletes nothing
Arm on A master switch that pauses new timers without touching your rules

How the waiting list works

Messages waiting to be deleted are stored in your browser database inside Discord, so they survive a restart. The plugin keeps a single timer set to the next deadline rather than one timer per message.

If messages came due while Discord was closed, they are cleared out slowly on the next start, one every 2.5 seconds, and you get a notice saying how many. Going slowly here is deliberate: a sudden burst of deletions is the thing worth avoiding.

If a delete request fails, it is tried once more and then dropped with a note in the log. A message that was already gone counts as done. Repeated failures make the queue slow down instead of retrying harder.

Tests

The scheduling and rule logic are covered by 148 tests that run on a fake clock, so timing, catch up after a restart, saved state, and the reply walk are all checked without touching Discord.

node tests/run.mjs

They use the esbuild copy from the surrounding Vencord folder and need nothing installed of their own.

What it deliberately does not do

There is no bulk delete, no "remove my last 50 messages", and no way to aim it at an account or a server you are not in. Everything it deletes is a message you sent while it was already watching that place, one at a time, and you can always see what is queued.

Automating a user account is against the Discord Terms of Service in any form, and a client mod is not an exception to that. Use sensible timers.

Licence

GPL-3.0-or-later, the same licence as Vencord. There was a selfbot version before.

About

A Vencord plugin that puts a timer on the messages you send. Set it per channel, per category or per server, with a live countdown and a keep button.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages