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,
|
TextInputBuilder,
|
||||||
TextInputStyle,
|
TextInputStyle,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import { naomiId } from "../config/entitlements.js";
|
import { adminUsers } from "../config/entitlements.js";
|
||||||
import { errorHandler } from "../utils/errorHandler.js";
|
import { errorHandler } from "../utils/errorHandler.js";
|
||||||
import type { Command } from "../interfaces/command.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
|
// eslint-disable-next-line max-lines-per-function -- Modal requires many input components
|
||||||
export const announcement: Command = async(_hikari, interaction) => {
|
export const announcement: Command = async(_hikari, interaction) => {
|
||||||
try {
|
try {
|
||||||
if (interaction.user.id !== naomiId) {
|
if (!adminUsers.includes(interaction.user.id)) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: "This command is restricted to the owner.",
|
content: "This command is restricted to administrators.",
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
* @author Naomi Carrigan
|
* @author Naomi Carrigan
|
||||||
*/
|
*/
|
||||||
const naomiId = "465650873650118659";
|
const naomiId = "465650873650118659";
|
||||||
|
const rhiaId = "1086567250145841252";
|
||||||
|
|
||||||
const entitledGuilds = [
|
const entitledGuilds = [
|
||||||
"1354624415861833870",
|
"1354624415861833870",
|
||||||
@@ -11,4 +12,9 @@ const entitledGuilds = [
|
|||||||
|
|
||||||
const entitledUsers = [ naomiId ];
|
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