Typed log functions + more

This commit is contained in:
Dragory 2021-08-18 01:51:42 +03:00
parent d2ac700143
commit bed6589d48
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
166 changed files with 4021 additions and 869 deletions

View file

@ -13,7 +13,7 @@ export async function isBanned(
): Promise<boolean> {
const botMember = pluginData.guild.members.cache.get(pluginData.client.user!.id);
if (botMember && !hasDiscordPermissions(botMember.permissions, Permissions.FLAGS.BAN_MEMBERS)) {
pluginData.getPlugin(LogsPlugin).log(LogType.BOT_ALERT, {
pluginData.getPlugin(LogsPlugin).logBotAlert({
body: `Missing "Ban Members" permission to check for existing bans`,
});
return false;
@ -37,7 +37,7 @@ export async function isBanned(
}
if (isDiscordAPIError(e) && e.code === 50013) {
pluginData.getPlugin(LogsPlugin).log(LogType.BOT_ALERT, {
pluginData.getPlugin(LogsPlugin).logBotAlert({
body: `Missing "Ban Members" permission to check for existing bans`,
});
}