import type { Guild } from 'discord.js';
/**
* Retrieve the command id for a specified guild.
* @param guild - The guild instance to get a command for
* @param name - The name of the command to find
* @returns The command id if a command matching name was found in the cache, or undefined if it was not
*/
function getGuildCommandId(guild: Guild, name: string): string | undefined {
return guild.commands.cache.find(command => command.name === name)?.id;
}
import type { Guild } from 'discord.js';
/**
* Retrieve the command id for a specified guild.
* @param guild - The guild instance to get a command for
* @param name - The name of the command to find
* @returns The command id if a command matching name was found in the cache, or undefined if it was not
*/
function getGuildCommandId(guild: Guild, name: string): string | undefined {
return guild.commands.cache.find(command => command.name === name)?.id;
}