9 |
import History from '../../automod/History'; |
import History from '../../automod/History'; |
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 KickCommand extends BaseCommand { |
export default class KickCommand extends BaseCommand { |
15 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
86 |
} |
} |
87 |
|
|
88 |
try { |
try { |
89 |
if (!user.kickable) |
if (!user.kickable || shouldNotModerate(client, user)) |
90 |
throw new Error('User not kickable'); |
throw new Error('User not kickable'); |
91 |
|
|
92 |
await user.kick(reason); |
await user.kick(reason); |
100 |
reason |
reason |
101 |
}); |
}); |
102 |
|
|
103 |
await History.create(user.id, msg.guild!, 'kick', msg.member!.user.id, typeof reason === 'undefined' ? null : reason); |
// await History.create(user.id, msg.guild!, 'kick', msg.member!.user.id, typeof reason === 'undefined' ? null : reason); |
104 |
} |
} |
105 |
catch (e) { |
catch (e) { |
106 |
await msg.reply({ |
await msg.reply({ |
135 |
] |
] |
136 |
}); |
}); |
137 |
} |
} |
|
} |
|
138 |
|
} |