[Cleanup] bot reports incorrect number of messages it mass deleted #4155
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot#4155
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Command bugs
Command name
[p]cleanup messages [>100]
What cog is this command from?
Cleanup
What were you expecting to happen?
Bot should report the exact or correct amount of messages it deleted from the given channel in console/logs.
What actually happened?
Bot reports incorrect amount of messages deleted in console. I think it passes the same number we give as input.
How can we reproduce this issue?
Load cleanup cog, if haven't.

Try to delete more than 100 messages in a given channel with
[p]cleanup messages. Confirm when prompted to.Try to pass an integer larger than the total number of messages of last 2 weeks which exists in the target channel. <- This step is essential to reproduce this bug.
Observe in your console/logs the amount the bot returns as deleted messages.
(^^for context in this screenshot, I used
[p]cleanup messages 500in a channel.)Now check your guild audit logs and see how many messages the bot actually deleted and cross-verify with the output bot provided in console/logs.

You should be able to confirm that bot reports incorrect number of messages it mass deleted.
While I have only observed and tested this with
[p]cleanup messagessubcommand, I assume the same bug should occur with other cleanup subcommands becuase of howcheck_100_plus()staticmethod is handled, though I could be wrong, but please verify it with othercleanupsubcommands.I can verify it is inaccurate with
[p]cleanup messages.cleanup after- workingcleanup before- workingcleanup between- workingcleanup bot- working (there is an unnecessary space after the number in the logs though)cleanup messages- as you established, not workingcleanup self- workingcleanup spam- workingcleanup text- workingcleanup user- workingTLDR: Just cleanup messages
Sigh, too late it's already got a PR. Poor Vexed's testing server now having a destroyed message history...
I destroyed mine in the process too, don't worry! :D