Skip to content

fix: check category before moving to appeal category #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

vivekashok1221
Copy link
Member

@vivekashok1221 vivekashok1221 commented Feb 19, 2025

With PR #31, modmail threads are automatically moved to the ban appeal category if a user with an open thread gets banned and then joins the ban appeal server. The bot will also send an embed stating ""Moving thread to 📩|Modmail Appeals category since recipient has joined the appeals server.""

However, currently, if a user who is actively appealing leaves and rejoins the ban appeal server, the bot will send an embed stating "Moving thread to 📩|Modmail Appeals category since recipient has joined the appeals server."- even if the user's modmail thread is already in the appeals category.

This PR will ensure that the bot will not attempt to move the thread to ban appeal category if it's already in the ban appeal category and also ensure that the correct message of "The recipient has joined the Appeals server" is sent.

I've tested the changes using the staff Bot Test Server as the main guild and my private test server as the appeals guild
image

Instructions for local testing:

  1. I've never had any success trying to load local plugins, so I always load plugins from GitHub.
    Fork our plugin repo, switch to the rejoin-appeal-category branch, and update the guild ID in this line to your test appeal server's guild ID (this can be any server where both your bot and the account you're banning have access).

  2. Clone the ModMail repo:

git clone https://github.com/modmail-dev/Modmail
  1. If you're using the staff Bot Test Server as the main server, you can use this as your .env file:
TOKEN=<your token>
LOG_URL=https://logviewername.herokuapp.com/
GUILD_ID=476190141161930753
MODMAIL_GUILD_ID=476190141161930753
OWNERS=476190391595433985
CONNECTION_URI=mongodb+srv://mongodburi
  1. Start the bot:
cd Modmail
docker compose up
  1. Run the following commands in discord:
?appeal_category_management add 1080759008748634162

(you can replace the category ID with the name of your appeal category if you're using a private test server as the main server)

?plugins add <your username>/modmail-plugins/ban_appeals@rejoin-appeal-category

This is to prevent attempting to move the thread to the ban appeal category when a
user leaves and rejoins the ban appeal server.
@ChrisLovering ChrisLovering merged commit c448800 into main Feb 20, 2025
1 check passed
@ChrisLovering ChrisLovering deleted the rejoin-appeal-category branch February 20, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants