-
Notifications
You must be signed in to change notification settings - Fork 9
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
Modmail #227
Modmail #227
Conversation
Looks like the |
} | ||
} else if ( banStatus !== undefined ) { | ||
try { | ||
await origin.channel.send( 'We\'re sorry, but you have been banned from sending any further modmail messages.' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we haven't taken DM rate limiting into account (not too big of a deal imo), this could be removed and left with the reaction to the message instead.
Could this also forward screenshots/images attached to the message? A user may attach one to a modmail message. |
I haven't fully looked at this PR but it's certainly something I'm excited about. With the new Discord features now available, I think the best solution would be to have a thread for each user who messages MojiraBot via DMs in the modmail channel. That's probably not too easy to implement though and as such out of scope for this PR, so let's just land this first and then we can still expand on it later if necessary. (tbh I don't think the volume of modmail would be too large anyway) |
I'll need to refactor parts of the PR to match discord's and the bot's new changes, so I can add threads while I do that :) |
I've switched the system to use threads, and it will now forward attachments on messages as well. Threads are archived after 24 hours, so a new thread will be created for new messages from that user afterwards, just to make sure modmails are seen. This one is now ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to apologize for taking this long to look at the PR. I don't have a good reason for that, I just procrastinated on it too much.
Thank you for adding this - it's very much needed. No concerns about the code itself.
I had concerns over the DM channel no longer being usable as a personal place to try out commands, but I noticed that with the slash commands this is not really possible anymore anyway.
I do not like MojiraBot having too many distinct feature sets: It is responsible for ticket embeds, feeds, requests, and now also modmail. Optimally I'd like to separate these four responsibilities into four separate bots for easier maintenance. This would also allow us to finally make this bot publicly accessible, in particular the parts of it responsible for ticket embeds (and maybe also feeds). But this is way out of scope for this PR.
With that being said, let's finally merge this!
Purpose
Resolve #226 (probably worth discussing before merging, but it has already been discussed and the general consensus is so far in favor of this)
Add the database functionality!
Approach
DMs to Mojira Bot are forwarded to an internal channel and put into a thread.
/modmailban to ban a user from using the modmail system.
/modmailunban to unban a user from using the modmail system.
Reply in a modmail message thread to send a reply back to the user.
Threads will be archived after 24h of inactivity, after which a new thread will be created for subsequent messages
Future work
New channel needed for modmail, combine with #209's message event handler.
Add direct reply functionality when discord.js v13 is added.