11 |
import { fetchEmojiStr } from '../../utils/Emoji'; |
import { fetchEmojiStr } from '../../utils/Emoji'; |
12 |
import ms from 'ms'; |
import ms from 'ms'; |
13 |
import { clearTimeoutv2, getTimeouts, setTimeoutv2 } from '../../utils/setTimeout'; |
import { clearTimeoutv2, getTimeouts, setTimeoutv2 } from '../../utils/setTimeout'; |
14 |
|
import { shouldNotModerate } from '../../utils/util'; |
15 |
|
|
16 |
export default class tempBanCommand extends BaseCommand { |
export default class tempBanCommand extends BaseCommand { |
17 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
133 |
time = ms(time); |
time = ms(time); |
134 |
|
|
135 |
try { |
try { |
136 |
|
try { |
137 |
|
const member = await msg.guild?.members.fetch(user.id); |
138 |
|
|
139 |
|
if (member && shouldNotModerate(client, member)) { |
140 |
|
await msg.reply({ |
141 |
|
embeds: [ |
142 |
|
new MessageEmbed() |
143 |
|
.setColor('#f14a60') |
144 |
|
.setDescription(`This user cannot be tempbanned.`) |
145 |
|
] |
146 |
|
}); |
147 |
|
|
148 |
|
return; |
149 |
|
} |
150 |
|
} |
151 |
|
catch (e) { |
152 |
|
console.log(e); |
153 |
|
return; |
154 |
|
} |
155 |
|
|
156 |
await msg.guild?.bans.create(user, banOptions); |
await msg.guild?.bans.create(user, banOptions); |
157 |
|
|
158 |
const punishment = await Punishment.create({ |
const punishment = await Punishment.create({ |
225 |
return; |
return; |
226 |
} |
} |
227 |
} |
} |
|
} |
|
228 |
|
} |