-
Notifications
You must be signed in to change notification settings - Fork 18
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
Added ban command #350
Added ban command #350
Conversation
The code could also be adapted to make a "soft-ban" or "kick" command. Also, |
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 think there should be another parameter that determines whether the user's past messages are deleted.
config/dev/vars.template.json
Outdated
@@ -5,5 +5,6 @@ | |||
"ANNOUNCEMENTS_CHANNEL_ID": "CHANNEL_ID", | |||
"OFFICE_STATUS_CHANNEL_ID": "CHANNEL_ID", | |||
"RESUME_CHANNEL_ID": "CHANNEL_ID", | |||
"IRC_USER_ID": "USER_ID" | |||
"IRC_USER_ID": "USER_ID", | |||
"USER_ID_OF_MOD_FOR_APPEAL": "USER_ID" |
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.
Would MOD_USER_ID_FOR_BAN_APPEAL
be more clear?
|
||
// Get the GuildMember object corresponding to the user in the guild | ||
// This is needed because we can only ban GuildMembers, not Users | ||
const guild = await client.guilds.fetch(vars.TARGET_GUILD_ID); |
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.
Do you mind updating the description of TARGET_GUILD_ID
in SETUP.md
, since right now, it looks like it is only used for coffee chats?
I didn't add the kick/soft ban options since with each of these (I think) the user can just rejoin. With banning this isn't an option, so this functionality is needed. |
After further investigation, it turns out that Dyno, a bot in CSC, has more powerful ban commands that also support appeals: No point reinventing the wheel, so I'm closing this PR. |
On second glance, there might be more nuances to the Dyno ban command that make making a custom ban command more preferable. Reopening this PR for now. |
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 left some comments.
52407d3
to
18fce01
Compare
src/commandDetails/admin/ban.ts
Outdated
}, | ||
{ | ||
name: 'days', | ||
description: "Messages in last 'days' days from user are deleted. Default is no days.", |
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.
Can no
be 0
instead? I think it would sound better this way.
18fce01
to
3b06b57
Compare
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.
LGTM!
Summary of Changes
Added a custom ban command for Codey.
Motivation and Explanation
Dyno has a generic ban command, but we wanted to make our own in the linked issue. This custom ban command bans the user, as well as sends a customized ban message to the bannee with the reason why they were banned, and how they can appeal the ban (message a mod).
Related Issues
Resolves #185
Steps to Reproduce
Run
/ban
or.ban
.Demonstration of Changes
The bannee gets a DM from Codey similar to the following:
Further Information and Comments