-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 New "moderation tools" system, enable or disable moderation features 🔗 Discord invites suppressor can be enabled with moderation tools menu (disabled by default) ⏹️ moderation-tools-buttons.js to enable a specific feature from a button interraction 🛹 moderation-tools-select.js handler for the selected moderation tools 🗃️ New moderationTools field in db model ⚙️ UseApplicationCommands user permission now required to use commands ✍️ Removed the redundant "Setup" repeat for the setup menu ❎ Removed .gitattributes file 📂 Change location of setup-Ids.js
- Loading branch information
Pexilo
committed
Aug 30, 2022
1 parent
f1d7440
commit 8d93453
Showing
13 changed files
with
173 additions
and
19 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const { Button } = require("sheweny"); | ||
|
||
module.exports = class moderationToolsButtons extends Button { | ||
constructor(client) { | ||
super(client, ["blacklist-tool", "delDcInvites-tool"]); | ||
} | ||
|
||
async execute(button) { | ||
if (!(await this.client.Defer(button))) return; | ||
|
||
const { guild } = button; | ||
const fetchGuild = await this.client.getGuild(guild); | ||
const moderationTools = fetchGuild.moderationTools.enabled; | ||
|
||
switch (button.customId) { | ||
case "blacklist-tool": | ||
moderationTools.push("blacklist"); | ||
|
||
button.editReply({ | ||
content: | ||
"`🛡️` Blacklist feature is now enabled ✅\n\n> You can re-run your command", | ||
}); | ||
break; | ||
|
||
case "delDcInvites-tool": | ||
moderationTools.push("delDcInvites"); | ||
|
||
button.editReply({ | ||
content: | ||
"`🔗` Discord links suppressor is now enabled ✅\n\n> You can re-run your command", | ||
}); | ||
break; | ||
} | ||
|
||
await this.client.updateGuild(guild, { | ||
"moderationTools.enabled": moderationTools, | ||
}); | ||
} | ||
}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const { SelectMenu } = require("sheweny"); | ||
|
||
module.exports = class moderationToolsSelect extends SelectMenu { | ||
constructor(client) { | ||
super(client, ["moderation-tools-select"]); | ||
} | ||
|
||
async execute(selectMenu) { | ||
if (!(await this.client.Defer(selectMenu))) return; | ||
const { guild, values } = selectMenu; | ||
|
||
await this.client.updateGuild(guild, { | ||
"moderationTools.enabled": values, | ||
}); | ||
|
||
const spelledValues = values | ||
.map((value) => { | ||
switch (value) { | ||
case "blacklist": | ||
return "\n`🛡️` Blacklist"; | ||
case "delDcInvites": | ||
return "\n`🔗` Discord Invites Suppressor"; | ||
} | ||
}) | ||
.join(", "); | ||
|
||
return selectMenu.editReply({ | ||
content: `**Moderation tools enabled:**${ | ||
!spelledValues ? " ❎" : spelledValues | ||
}`, | ||
}); | ||
} | ||
}; |
This file contains 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