Skip to content

purge/clear command #17

Closed
Closed

Description

@Tais993

Issue

Whenever theres a spam bot, or something related, deleting messages by hand isn't exactly an option.
At the times the moderators aren't active or online, this means manual removal of their messages.

Implementation

Undetermined, read the convo's

Alternatives

Waiting for moderators to join the party

Activity

  1. added
    enhancement
    on Sep 6, 2021
  2. self-assigned this
    on Sep 6, 2021
  3. Zabuzard commented on Sep 6, 2021

    @Zabuzard
    Member

    I propose a different logic to the command, basically I would align it to the other commands (the ban functionality specifically), which just deletes all messages from the last day or so.

    It would be simpler to use and I think it would cover the use case as well.

  4. Tais993 commented on Sep 6, 2021

    @Tais993
    MemberAuthor

    This requires us to cache every single message for 1 day, it's possible but sounds overkill to me.

    Or helpers receive ban permissions (which shouldn't happen imo)

  5. AzatothTheAwakened commented on Sep 6, 2021

    @AzatothTheAwakened
    Member

    Rename it "purge" because thats usually how its called in other bots

  6. changed the title [-]Clear command[/-] [+]purge/clear command[/+] on Sep 6, 2021
  7. java-coding-prodigy commented on Sep 8, 2021

    @java-coding-prodigy
    Contributor

    Could we make it such that passing multiple users as arguments would delete the previous 100(if 100 is passed as an argument) messages of those users? We would have to keep varargs as an argument and the no of messages too, but then the vararg would have to be the final parameter.

  8. Tais993 commented on Sep 8, 2021

    @Tais993
    MemberAuthor

    100 messages of those users
    This either requires us to store all messages send, or we need to retrieve ... messages from each channel to find their messages.
    Both are, not really a nice solution imo.

    One feels like a waste of storage, and one will cause rate-limits.
    If the user only send 99, and we still try to delete 100 the bot will keep retrieving messages.
    So there needs to be a limit of when the bot stops retrieving.

    For your info, bots can't do "from:Tijs#0002" to see all messages send by "Tijs#0002"
    The search API is only for users, so these kind of commands are hard to properly make.

  9. Tais993 commented on Sep 8, 2021

    @Tais993
    MemberAuthor

    Thanks Github for removing the 0's..
    And since both you and Zabuzard mentioned caching messages.
    We can think about this, but we need to set a limit on when messages will be removed.

    Like, we will store user ID's and message ID's for 5 days?

    I honestly don't know how much storage this takes, so I'm not sure how realistic this is.
    We can just try it when the vps is ready, see #27
    After results from how much storage messages take we can decide further if everyone is alright with that?

  10. added
    blocked
    on Sep 9, 2021
  11. Zabuzard commented on Sep 9, 2021

    @Zabuzard
    Member

    Blocked by #59

  12. changed the title [-]purge/clear command[/-] [+][FEATURE] purge/clear command[/+] on Sep 9, 2021
  13. added this to the Improvement phase 1 milestone on Sep 9, 2021
  14. added
    new command
    and removed
    enhancement
    on Sep 9, 2021
  15. 13 remaining items

  16. Tais993 commented on Oct 23, 2021

    @Tais993
    MemberAuthor

    If we go for user specific purge commands, we still need to decide it's full implementation.

    Since it requires storing users their messages, we'll need to decide for how long we'll store messages.

    500 messages max, 100, less more?
    5 days max, 2 days max, less more?

  17. Zabuzard commented on Oct 23, 2021

    @Zabuzard
    Member

    We dont need to store the actual content though. Only message id , author id and timestamp. Or something like that.

    The #117 command actually already added such a database table which stores such message metadata up to 30 days, I think.

  18. RealYusufIsmail commented on Oct 28, 2021

    @RealYusufIsmail
    Contributor

    Regarding this command. I have my closed my original pr and will open a new one. I will make 2 commands clear and purge. The clear command will allow you to clear a vast number of messages. This is useful for occasion such as raids and then i will will create a purge command which will allow you to delete specific messages

  19. Tais993 commented on Oct 28, 2021

    @Tais993
    MemberAuthor

    Just create 1 command and use subcommands

  20. Zabuzard commented on Oct 28, 2021

    @Zabuzard
    Member

    For completeness, let me repeat the functionallity I want:

    • I can give the command a message ID from
    • I can give the command an optional message ID to (if not given, it will just assume "all" or "most recent" message as end point)
      It then deletes all messages in the current channel between those two message IDs.

    Therefore, methods like MessageChannel#getHistoryAfter and similar might be useful.

  21. Zabuzard commented on Oct 28, 2021

    @Zabuzard
    Member

    I am lowering priority of this command since (as far as I can think back), we never had such a situation in our server yet. Only situations in which you would also want to ban (and then messages are deleted anyways).

    But sure, being prepared for a raid or something is never a bad thing.

  22. RealYusufIsmail commented on Oct 28, 2021

    @RealYusufIsmail
    Contributor

    For completeness, let me repeat the functionallity I want:

    • I can give the command a message ID from
    • I can give the command an optional message ID to (if not given, it will just assume "all" or "most recent" message as end point)
      It then deletes all messages in the current channel between those two message IDs.

    Therefore, methods like MessageChannel#getHistoryAfter and similar might be useful.

    Ok. I see what you want. I will make one command called purge in which you can do
    /purge messageid(from) messagid(to)

  23. linked a pull request that will close this issueCreate new Purge command. #238on Nov 5, 2021
  24. Zabuzard commented on Dec 16, 2021

    @Zabuzard
    Member

    Closing in favor of duplicate #330 .

  25. added
    duplicate
    on Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicatenew commandpriority: low

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions