Repository navigation
feat(mod): add /mod cleanup command to reset #access-help - #103
Closed
IbrahimCart wants to merge 1 commit into
Closed
IbrahimCart wants to merge 1 commit into
IbrahimCart wants to merge 1 commit into
Conversation
Adds a moderation slash command that purges #access-help, reposts the two onboarding messages, pins them, removes the pin notices and logs the cleanup to the mod-logs channel. Only #access-help is accepted for now. Closes pesu-dev#92
Contributor
|
@IbrahimCart were you even assigned the issue? are you part of PES university? |
Author
|
Hi @achyu-dev, thanks for replying, and sorry for opening the PR before being assigned. I'm not part of PES University. I'm a student at the University of Washington, and I'm doing this as a class project (TCSS 490) where I contribute to an open-source project. I should have waited for an answer on #92 before opening it. If you're open to it, I'd be glad to be assigned and reopen it. Otherwise I understand if this issue is meant for your own community. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Description
Adds a new moderation slash command,
/mod cleanup <channel>, as requested in #92.It resets the
#access-helpchannel: it purges all messages, reposts the two standard onboarding / authentication-checklist messages from the issue, pins them, removes the "pinned a message" system notices Discord adds, and sends an audit embed to the mod-logs channel. For now only#access-helpis accepted; any other channel gets an ephemeral error.src/cogs/mod/commands.py, modelled on/mod purge(same defer / location / role / error decorators: admin, mod, junior mod).src/cogs/mod/helpers.py; a test checks each stays under Discord's 2000-character limit./helpmod menu.Closes #92
🧱 Type of Change
🧪 How Has This Been Tested?
tests/unit/)tests/integration/)New unit tests cover: a channel other than
#access-helpis rejected and nothing is purged; a user without a moderator role cannot run it; purge is called withlimit=None, both messages are sent and pinned, and the audit embed is sent; the message lengths; and the pin-notice cleanup.I have not run the command in a live Discord server (no MongoDB / bot token / test guild set up on my machine), so the Discord-side behaviour (purging more than 14-day-old messages, pin permissions) is untested beyond mocks. Happy to adjust if you see anything off.
✅ Checklist
.envvars updated (if applicable)🛠️ Affected Bot Areas
/ping,/help)📸 Screenshots / Demos (if applicable)
None yet, since I have not been able to run it in a Discord server.
🧠 Additional Notes
#access-help, as noted in the issue./linkcommand ID (1532610288950448129) and the admin mention from the issue; please check they match production.