feat: dev perm override
vi v@vt3e.cat
Sun, 01 Mar 2026 05:07:24 +0000
1 files changed,
9 insertions(+),
5 deletions(-)
M
src/interactions/commands/config.ts
→
src/interactions/commands/config.ts
@@ -152,7 +152,12 @@ const action = interaction.options.getString("action", true);
const role = interaction.options.getRole("role") as Role | null; const guildId = interaction.guild.id; - if (!(await hasManagerPermissions(interaction.member as GuildMember))) { + const isDeveloper = interaction.user.id === cfg.developerId; + const hasPerms = await hasManagerPermissions( + interaction.member as GuildMember, + ); + + if (!isDeveloper && !hasPerms) { await interaction.reply({ content: "❌ You do not have manager permissions to run this action.", flags: ["Ephemeral"],@@ -215,7 +220,7 @@ })
.execute(); await interaction.reply({ - content: `✅ added ${role} as a manager role.`, + content: `✅ Added ${role} as a manager role.`, flags: ["Ephemeral"], }); return;@@ -228,7 +233,7 @@ .where(eq(managerTable.roleId, role.id))
.execute(); await interaction.reply({ - content: `✅ removed ${role} from manager roles.`, + content: `✅ Removed ${role} from manager roles.`, flags: ["Ephemeral"], }); return;@@ -262,7 +267,6 @@ }
const guildId = interaction.guild.id; - // use getGuild to ensure a row exists await getGuild(guildId); if (isChannelKey(key)) {@@ -336,7 +340,7 @@ .execute();
if (!result || result.length === 0) { await interaction.reply({ - content: "📋 no configuration found for this server.", + content: "📋 No configuration found for this server.", flags: ["Ephemeral"], }); return;