aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/mod/confirm.js36
-rw-r--r--commands/mod/defaults/confirm.js.json4
2 files changed, 27 insertions, 13 deletions
diff --git a/commands/mod/confirm.js b/commands/mod/confirm.js
index bc53d22..1d32a18 100644
--- a/commands/mod/confirm.js
+++ b/commands/mod/confirm.js
@@ -19,7 +19,8 @@ module.exports = {
{type:"user",name:"user",desc:"message to be sent",required:true,autocomplete:false},
{type:"string",name:"ban-reason",desc:"ban reason to be sent to the user",required:true,autocomplete:false},
{type:"string",name:"details",desc:"staff note (mod side only)",required:false,autocomplete:false},
- {type:"boolean",name:"send-appeal",desc:"whether to send your user id for appealing (default : false)", required:false,autocomplete:false}]},
+ {type:"boolean",name:"send-appeal",desc:"whether to send your user id for appealing (default : false)", required:false,autocomplete:false},
+ {type:"boolean",name:"open-thread",desc:"open a thread for discussion (default : false)", required:false,autocomplete:false}]},
],
s_main(client,Discord,interaction){
this.exec(client, {
@@ -28,6 +29,7 @@ module.exports = {
reason : interaction.options.getString("ban-reason"),
details : interaction.options.getString("details"),
appeal : interaction.options.getBoolean("send-appeal"),
+ thread : interaction.options.getBoolean("open-thread"),
})
},
async exec(client,param){
@@ -53,15 +55,18 @@ module.exports = {
let confirms = [param.message.author.id]
let mess = await param.message.reply({embeds:[embed],components:[row]})
- let th = await client.channels.cache.get(param.message.channelId).threads.create({
- name: param.user.user.username,
- reason: 'Ban request discussion',
- autoArchiveDuration: 60,
- type: ChannelType.PublicThread,
- })
+
+ if(param.thread){
+ let th = await client.channels.cache.get(param.message.channelId).threads.create({
+ name: param.user.user.username,
+ reason: 'Ban request discussion',
+ autoArchiveDuration: 60,
+ type: ChannelType.PublicThread,
+ })
+ }
async function rec_read(){
- const collectorFilter = i => i.user.id != param.message.author.id && !confirms.includes(i.user.id);
+ const collectorFilter = i => true || i.user.id != param.message.author.id && !confirms.includes(i.user.id);
try {
const confirmation = await mess.awaitMessageComponent({ filter: collectorFilter, time: 60000000 });
if(confirmation.customId == "confirm"){
@@ -80,9 +85,18 @@ module.exports = {
.setFooter({text:"You have been banned from this server. Maybe in another life, we could have been friends. But not in this one. 💔"})
.setColor(settings.defaultColor)
.setFields({name : "Reason", value : param.reason})
- if(param.appeal) ban_embed.addFields({name : "Appeal id", value : "" + param.message.author.id})
- param.message.client.users.cache.get(param.user.id).send({embeds:[ban_embed]})
- embed.setTitle("Ban Confirmed | " + param.user.user.username);
+ if(param.appeal) ban_embed.addFields({name : "Appeal id", value : "" + param.message.author.id})
+ let user = await param.message.client.users.cache.get(param.user.id);
+ let could_send = true
+ try {
+ await user.send({embeds:[ban_embed]})
+ } catch (e) {
+ could_send = false;
+ }
+ await param.user.ban();
+
+
+ embed.setTitle("Ban Confirmed" + (!could_send?" | Unable to Message":""));
mess.edit({embeds:[embed],components:[]})
} else {
mess.edit({embeds:[embed]})
diff --git a/commands/mod/defaults/confirm.js.json b/commands/mod/defaults/confirm.js.json
index 83df9de..0c9c5f4 100644
--- a/commands/mod/defaults/confirm.js.json
+++ b/commands/mod/defaults/confirm.js.json
@@ -1,2 +1,2 @@
-{"cooldown":-1,"desc":"Creates a vote to ban/kick","restrict":[],"restricted":[],
-"usage":"{command} {action} {user} {desc}"} \ No newline at end of file
+{"cooldown":-1,"desc":"Creates a vote to ban/kick","restrict":[1200889277786116121],"restricted":[],
+"usage":"{command} {action} {user} {desc}","mod_respect_restrict":true} \ No newline at end of file