generated from nhcarrigan/template
refactor: replace entitledUsers owner gate with naomiId
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
|||||||
TextInputBuilder,
|
TextInputBuilder,
|
||||||
TextInputStyle,
|
TextInputStyle,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import { entitledUsers } from "../config/entitlements.js";
|
import { naomiId } 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,7 +24,7 @@ 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 (!entitledUsers.includes(interaction.user.id)) {
|
if (interaction.user.id !== naomiId) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: "This command is restricted to the owner.",
|
content: "This command is restricted to the owner.",
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Naomi Carrigan
|
* @author Naomi Carrigan
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { entitledGuilds, entitledUsers } from "../config/entitlements.js";
|
import { entitledGuilds, naomiId } from "../config/entitlements.js";
|
||||||
import type { Client, Guild, User } from "discord.js";
|
import type { Client, Guild, User } from "discord.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,7 +17,7 @@ const checkUserEntitlement = async(
|
|||||||
hikari: Client,
|
hikari: Client,
|
||||||
user: User,
|
user: User,
|
||||||
): Promise<boolean> => {
|
): Promise<boolean> => {
|
||||||
if (entitledUsers.includes(user.id)) {
|
if (user.id === naomiId) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const entitlements = await hikari.application?.entitlements.fetch({
|
const entitlements = await hikari.application?.entitlements.fetch({
|
||||||
|
|||||||
Reference in New Issue
Block a user