From dfe4e4598486ff07dd0ecb077ec1d766d2fb2380 Mon Sep 17 00:00:00 2001 From: Tarrgon <61888458+Tarrgon@users.noreply.github.com> Date: Fri, 5 Jun 2026 12:52:07 -0400 Subject: [PATCH] Fix eslint optional non-null assertion --- src/buttons/dev-watch.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/buttons/dev-watch.ts b/src/buttons/dev-watch.ts index cfddb0c..ee61a06 100644 --- a/src/buttons/dev-watch.ts +++ b/src/buttons/dev-watch.ts @@ -14,7 +14,8 @@ export default { const bot = await interaction.guild.members.fetchMe(); const role = await interaction.guild?.roles.fetch(settings.devwatch_role_id); - if (role?.position! > bot.roles.highest.position) throw new Error('The configured `devwatch_role_id` is higher than my highest role.'); + if (!role) throw new Error('The configured `devwatch_role_id` does not exist.'); + if (role.position > bot.roles.highest.position) throw new Error('The configured `devwatch_role_id` is higher than my highest role.'); if (member.roles.cache.has(settings.devwatch_role_id)) { await member.roles.remove(settings.devwatch_role_id);