3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-16 22:55:03 +00:00

added default reasons object

This commit is contained in:
iamshoXy 2023-12-29 15:40:56 +01:00
parent ac3eb74500
commit ed5214d4ec
6 changed files with 48 additions and 28 deletions

View file

@ -33,7 +33,6 @@ export async function banUserId(
banOptions: BanOptions = {},
banTime?: number,
): Promise<BanResult> {
const config = pluginData.config.get();
const user = await resolveUser(pluginData.client, userId);
if (!user.id) {
return {
@ -42,7 +41,8 @@ export async function banUserId(
};
}
reason = reason || (config.default_ban_reason || "No reason specified");
const config = pluginData.config.get();
reason ||= config.default_reasons?.ban || "No reason specified";
// Attempt to message the user *before* banning them, as doing it after may not be possible
const member = await resolveMember(pluginData.client, pluginData.guild, userId);