generated from nhcarrigan/template
feat: add Rhia as admin user for announcement command
Add Rhia's Discord ID to the admin users list, allowing her to run the /announcement command alongside Naomi. Updated the permission check to use a shared adminUsers array. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
TextInputBuilder,
|
||||
TextInputStyle,
|
||||
} from "discord.js";
|
||||
import { naomiId } from "../config/entitlements.js";
|
||||
import { adminUsers } from "../config/entitlements.js";
|
||||
import { errorHandler } from "../utils/errorHandler.js";
|
||||
import type { Command } from "../interfaces/command.js";
|
||||
|
||||
@@ -24,9 +24,9 @@ import type { Command } from "../interfaces/command.js";
|
||||
// eslint-disable-next-line max-lines-per-function -- Modal requires many input components
|
||||
export const announcement: Command = async(_hikari, interaction) => {
|
||||
try {
|
||||
if (interaction.user.id !== naomiId) {
|
||||
if (!adminUsers.includes(interaction.user.id)) {
|
||||
await interaction.reply({
|
||||
content: "This command is restricted to the owner.",
|
||||
content: "This command is restricted to administrators.",
|
||||
ephemeral: true,
|
||||
});
|
||||
return;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
const naomiId = "465650873650118659";
|
||||
const rhiaId = "1086567250145841252";
|
||||
|
||||
const entitledGuilds = [
|
||||
"1354624415861833870",
|
||||
@@ -11,4 +12,9 @@ const entitledGuilds = [
|
||||
|
||||
const entitledUsers = [ naomiId ];
|
||||
|
||||
export { entitledGuilds, entitledUsers, naomiId };
|
||||
/**
|
||||
* User IDs allowed to run administrative commands.
|
||||
*/
|
||||
const adminUsers = [ naomiId, rhiaId ];
|
||||
|
||||
export { adminUsers, entitledGuilds, entitledUsers, naomiId };
|
||||
|
||||
Reference in New Issue
Block a user