BulletBot icon indicating copy to clipboard operation
BulletBot copied to clipboard

Purge command with no criterias deletes new messages until it reaches specified amount

Open Jet132 opened this issue 5 years ago • 0 comments

Describe the bug When you use the ?!purge command with no criteria (so just ?!purge [number]) the bot will also delete future messages until it finally deleted the specified amount of messages.

To Reproduce Steps to reproduce the behavior:

  1. Make a new Channel
  2. Do ?!purge 3
  3. Send 4 new messages
  4. All messages except the last message get deleted (so 3)

Expected behavior It should only delete messages from the past and stop after there are no more deletable messages left.

Problem Line The problem can be tracked to https://github.com/CodeBullet-Community/BulletBot/blob/67187911009f06aa2ae959ffe5d3334511d7fec8/src/commands/Moderation/purge.ts#L280 What needs to be fixed is that it stops after there are no more deletable messages left and that it only deletes past messages to prevent new messages from being deleted after calling the purge command getting deleted while the bot is purging.

Jet132 avatar Mar 30 '20 16:03 Jet132