9 |
import Punishment from '../../models/Punishment'; |
import Punishment from '../../models/Punishment'; |
10 |
import PunishmentType from '../../types/PunishmentType'; |
import PunishmentType from '../../types/PunishmentType'; |
11 |
import { fetchEmojiStr } from '../../utils/Emoji'; |
import { fetchEmojiStr } from '../../utils/Emoji'; |
12 |
|
import { shouldNotModerate } from '../../utils/util'; |
13 |
|
|
14 |
export default class SoftBanCommand extends BaseCommand { |
export default class SoftBanCommand extends BaseCommand { |
15 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
125 |
reply = <Message> await msg.fetchReply(); |
reply = <Message> await msg.fetchReply(); |
126 |
|
|
127 |
try { |
try { |
128 |
|
try { |
129 |
|
const member = await msg.guild!.members.fetch(user.id); |
130 |
|
|
131 |
|
if (member && shouldNotModerate(client, member)) { |
132 |
|
await msg.reply({ |
133 |
|
embeds: [ |
134 |
|
new MessageEmbed() |
135 |
|
.setColor('#f14a60') |
136 |
|
.setDescription('This user cannot be softbanned.') |
137 |
|
] |
138 |
|
}); |
139 |
|
|
140 |
|
return; |
141 |
|
} |
142 |
|
} |
143 |
|
catch (e) { |
144 |
|
console.log(e); |
145 |
|
return; |
146 |
|
} |
147 |
|
|
148 |
await msg.guild?.bans.create(user, banOptions); |
await msg.guild?.bans.create(user, banOptions); |
149 |
await new Promise(r => setTimeout(r, 1600)); |
await new Promise(r => setTimeout(r, 1600)); |
150 |
await msg.guild?.bans.remove(user); |
await msg.guild?.bans.remove(user); |
197 |
return; |
return; |
198 |
} |
} |
199 |
} |
} |
|
} |
|
200 |
|
} |