-
Notifications
You must be signed in to change notification settings - Fork 0
Interfaces and Types
An interface representing the configuration flags used for running commands in the bot.
This configuration is specifically used to control various runtime aspects of command execution.
Default value: undefined
The ID of the test guild for command testing purposes. If provided, commands will be deployed only to this guild.
Default value: []
An array of Discord user IDs (snowflakes) that have developer privileges.
Commands or functionalities restricted to developers will be accessible to users with IDs in this array.
Default value: "Only developers are allowed to run this command."
The message shown when a command restricted to developers is executed by a non-developer.
Default value: "Not enough permissions."
The message displayed when a user lacks the necessary permissions to execute a command.
Default value: "I don't have enough permissions."
The message displayed when the bot lacks the necessary permissions to execute a command.
const obj: RunFlags = {
testGuildId: "808701451399725116",
devs: ["671549251024584725"],
onlyDev: "Text to display when a user runs a developer command.",
userNoPerms: "Text to display when the user has insufficient permissions",
botNoPerms: "Text to display when the bot has insufficient permissions",
};An interface that represents anything you can do with the commands when they are run, BUT before YOUR code executes.
Default value: false
Enable debugger mode. Prints(almost) everything that happens behind the scenes of course not with the API itself.
Default value: false
Disabling Logging of the Command Loader. Not advisable but hey it's your bot.
Default value: false
Whether or not this is the production version of the bot. If set to true, commands labelled isDev will NOT be loaded. (Use the setDev() method in SlashCommandManager)
Default value: false
Clears ALL application commands on startup. (Slash commands, User commands, and Message commands.)
Default value: false
When debugger mode is enabled, Either log to console or a file.
const obj: LoaderOptions = {
debugger: true,
production: true,
disableLogs: true,
};An interface that represents anything you can do with the interactions when they are run, BUT before YOUR code executes.
Default value: false
Enable Debugger mode. Prints (almost) everything that happens behind the scenes of course not with the API itself.
Default value: false
Disabling Logging of the Context Menu Loader. Not advised but hey it's your bot. Default is false.
Default value: false
Clears Context Menus
Default value: false
When debugger mode is enabled, Either log to console or a file.
Interface that represents default string values for the loader to log to the console when it encounters a command/context menu.
Make sure you keep NAME in the string or else you will not know what happened to which command.
If there is no log in the console for a specific command, then it has been loaded, there are no edits and it has not been deleted.
Note:
These have multiple default values, as context menus and commands are different.
What to show for context menus/commands that load in
What to show for context menus/commands that gets edited.
What to show for context menus/commands that gets deleted.
What to show for context menus/commands that gets skipped. (Deleted and still marked as deleted.)
What to show for context menus/commands that gets loaded, but has no changes
const obj: LoaderOptions = {
loadedNoChanges: "NAME was loaded. No changes were made to NAME.",
loaded: "NAME has been registered successfully.",
edited: "NAME has been edited.",
deleted: "NAME has been deleted.",
skipped: "NAME was skipped. (Command deleted or set to delete.)",
};Type alias for the strings "selectMenu", "modal" and "button"
Yes this did not need documenting, but here it is.
Here's the exact definition because I genuinely don't know how to explain this.
export type InteractionTypeStringsMap<U extends string> = U extends "modal"
? ModalSubmitInteraction
: U extends "selectMenu"
? AnySelectMenuInteraction
: U extends "button"
? ButtonInteraction
: never;