9 |
import { fetchEmoji } from '../../utils/Emoji'; |
import { fetchEmoji } from '../../utils/Emoji'; |
10 |
import Punishment from '../../models/Punishment'; |
import Punishment from '../../models/Punishment'; |
11 |
import PunishmentType from '../../types/PunishmentType'; |
import PunishmentType from '../../types/PunishmentType'; |
12 |
|
import { shouldNotModerate } from '../../utils/util'; |
13 |
|
|
14 |
export default class MassBanCommand extends BaseCommand { |
export default class MassBanCommand extends BaseCommand { |
15 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
100 |
try { |
try { |
101 |
console.log(banOptions.reason); |
console.log(banOptions.reason); |
102 |
|
|
103 |
|
try { |
104 |
|
const member = await msg.guild?.members.fetch(user.id); |
105 |
|
|
106 |
|
if (member && shouldNotModerate(client, member)) { |
107 |
|
await msg.reply({ |
108 |
|
embeds: [ |
109 |
|
new MessageEmbed() |
110 |
|
.setColor('#f14a60') |
111 |
|
.setDescription('The user ' + user.tag + ' is not bannable.') |
112 |
|
] |
113 |
|
}); |
114 |
|
|
115 |
|
return; |
116 |
|
} |
117 |
|
} |
118 |
|
catch (e) { |
119 |
|
console.log(e); |
120 |
|
continue; |
121 |
|
} |
122 |
|
|
123 |
await Punishment.create({ |
await Punishment.create({ |
124 |
type: PunishmentType.BAN, |
type: PunishmentType.BAN, |
125 |
user_id: user.id, |
user_id: user.id, |
165 |
] |
] |
166 |
}); |
}); |
167 |
} |
} |
|
} |
|
168 |
|
} |