Added new API comments (part 4)

Added new API comments (part 4)
This commit is contained in:
Jasper
2025-01-14 16:40:17 +01:00
committed by GitHub
+74 -4
View File
@@ -52,22 +52,28 @@ export class ODConfigManager_Default extends ODConfigManager {
* This interface is an object which has all properties for the status object in the `general.json` config!
*/
export interface ODJsonConfig_DefaultStatusType {
/**Is the status enabled? */
enabled:boolean,
/**The type of status (e.g. playing, listening, custom, ...) */
type:Exclude<ODClientActivityType,false>,
/**The text for the status. */
text:string,
/**The status of the bot (e.g. online, invisible, idle, do not disturb) */
status:ODClientActivityStatus
}
/**## ODJsonConfig_DefaultMessageSettingsType `interface`
* This interface is an object which has all properties for the system/messages/... object in the `general.json` config!
* This interface is an object which has all properties for the "system"."messages".... object in the `general.json` config!
*/
export interface ODJsonConfig_DefaultMessageSettingsType {
/**Enable sending DM logs to the ticket creator for this action. */
dm:boolean,
/**Enable sending logsto the log channel for this action. */
logs:boolean
}
/**## ODJsonConfig_DefaultCmdPermissionSettingsType `type`
* This type is a collection of command permission settings for the system/permissions/... object in the `general.json` config!
* This type is a collection of command permission settings for the "system"."permissions".... object in the `general.json` config!
*/
export type ODJsonConfig_DefaultCmdPermissionSettingsType = "admin"|"everyone"|"none"|string
@@ -79,56 +85,96 @@ export type ODJsonConfig_DefaultCmdPermissionSettingsType = "admin"|"everyone"|"
*/
export class ODJsonConfig_DefaultGeneral extends ODJsonConfig {
declare data: {
/**This object contains a few URLs and metadata for the config. */
_INFO:{
/**A link to the Open Ticket documentation. */
support:string,
/**A link to the DJdj Development discord server. */
discord:string,
/**The version of Open Ticket this config is compatible with. */
version:string
},
/**The token of the bot. (Empty when using `tokenFromENV`) */
token:string,
/**Use the token from the `.env` file as `TOKEN=xxxxx`. */
tokenFromENV:boolean,
/**The main (hex) color used in almost every embed in the bot. */
mainColor:discord.ColorResolvable,
/**The language to use. Can be the id of the language or the id without the prefix when using `openticket:...`. */
language:string,
/**The prefix used in all text-commands. */
prefix:string,
/**The id of the discord server where the bot is used. */
serverId:string,
/**A list of discord role ids which are able to access all tickets & commands. */
globalAdmins:string[],
/**Are slash commands enabled? */
slashCommands:boolean,
/**Are text commands enabled? */
textCommands:boolean,
/**All settings related to the status of the bot. */
status:ODJsonConfig_DefaultStatusType,
/**All settings related to the ticket system. */
system:{
/**Remove all participants (except admins) from the ticket when it's closed. */
removeParticipantsOnClose:boolean,
/**Reply with an ephemeral message when a ticket is created. */
replyOnTicketCreation:boolean,
/**Reply with an ephemeral message when reaction roles are changed. */
replyOnReactionRole:boolean,
/**Use a translated config checker in the console. */
useTranslatedConfigChecker:boolean,
/**Prefer slash-commands over text-commands when displaying them in menu's and messages. */
preferSlashOverText:boolean,
/**Reply with "unknown command" when the prefix is used without a valid command. */
sendErrorOnUnknownCommand:boolean,
/**Display the question fields (in a ticket message) in code blocks. */
questionFieldsInCodeBlock:boolean,
/**Disable the (✅❌) buttons and directly run the action. */
disableVerifyBars:boolean,
/**Display error embeds/messages with red instead of the default bot color. */
useRedErrorEmbeds:boolean,
/**The emoji style used in the bot. This will affect all embeds, titles & messages in the bot. */
emojiStyle:"before"|"after"|"double"|"disabled",
/**Enable/disable the ticket claim & unclaim button in the ticket message. */
enableTicketClaimButtons:boolean,
/**Enable/disable the ticket close & re-open button in the ticket message. */
enableTicketCloseButtons:boolean,
/**Enable/disable the ticket pin & unpin button in the ticket message. */
enableTicketPinButtons:boolean,
/**Enable/disable the ticket delete button in the ticket message. */
enableTicketDeleteButtons:boolean,
/**Enable/disable the "with reason" button for all actions in the ticket message. */
enableTicketActionWithReason:boolean,
/**Enable/disable the delete without transcript feature (button & /delete command). */
enableDeleteWithoutTranscript:boolean,
/**All settings related to the log channel. */
logs:{
/**Enable logging. Individual actions should still be added via the `"system"."messages"..."logs"` */
enabled:boolean,
/**The channel to send logs to. */
channel:string
},
/**All settings related to global ticket limits. */
limits:{
/**Enable global ticket limits. */
enabled:boolean,
/**The maximum amount of tickets that are allowed in the server at the same time. */
globalMaximum:number,
/**The maximum amount of tickets that a user is allowed to create at the same time. */
userMaximum:number
},
/**Configure permissions for all Open Ticket commands & actions. */
permissions:{
help:ODJsonConfig_DefaultCmdPermissionSettingsType,
panel:ODJsonConfig_DefaultCmdPermissionSettingsType,
@@ -151,6 +197,7 @@ export class ODJsonConfig_DefaultGeneral extends ODJsonConfig {
autodelete:ODJsonConfig_DefaultCmdPermissionSettingsType
},
/**Configure dm & log messages for all Open Ticket commands & actions. */
messages:{
creation:ODJsonConfig_DefaultMessageSettingsType,
closing:ODJsonConfig_DefaultMessageSettingsType,
@@ -174,22 +221,32 @@ export class ODJsonConfig_DefaultGeneral extends ODJsonConfig {
* This interface is an object which has all basic properties for options in the `options.json` config!
*/
export interface ODJsonConfig_DefaultOptionType {
/**The id of this option. */
id:string,
/**The name of this option. */
name:string,
/**The description of this option. */
description:string,
/**The type of this option. This type also determines the other option-specific variables. */
type:"ticket"|"website"|"role",
/**All settings related to the button for the 3 option types. */
button:{
/**The emoji of the button. (can also be empty) */
emoji:string,
/**The label of the button (can also be empty) */
label:string
}
}
/**## ODJsonConfig_DefaultOptionButtonSettingsType `interface`
* This interface is an object which has all button settings for ticket options in the `options.json` config!
* This interface is an object which has all button settings for ticket & reaction role options in the `options.json` config!
*/
export interface ODJsonConfig_DefaultOptionButtonSettingsType {
/**The emoji of the button. (can also be empty) */
emoji:string,
/**The label of the button (can also be empty) */
label:string,
/**The color of the button (not available in options with the 'website' type!) */
color:ODValidButtonColor
}
@@ -197,14 +254,27 @@ export interface ODJsonConfig_DefaultOptionButtonSettingsType {
* This interface is an object which has all message embed settings for ticket options in the `options.json` config!
*/
export interface ODJsonConfig_DefaultOptionEmbedSettingsType {
/**Is this embed enabled? */
enabled:boolean,
/**The title of the embed. */
title:string,
/**The description of this embed. */
description:string,
/**A custom color for this embed. (The default bot color is used when empty) */
customColor:discord.ColorResolvable,
/**A URL to an image displayed in the embed. */
image:string,
/**A URL to a thumbnail displayed in the embed. */
thumbnail:string,
fields:{name:string, value:string, inline:boolean}[],
/**A list of fields displayed in the embed. */
fields:{
/**The name of this field. */
name:string,
/**The value of this field. => empty not allowed */
value:string,
inline:boolean
}[],
timestamp:boolean
}