Added new API comments (part 11)

This commit is contained in:
JasperAtSchool
2025-01-28 14:22:26 +01:00
parent 58fb7b7512
commit f6c70fa62a
31 changed files with 270 additions and 270 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import { ODWorkerManager, ODWorkerCallback, ODWorker } from "./worker"
import { ODDebugger } from "./console" import { ODDebugger } from "./console"
/**## ODActionImplementation `class` /**## ODActionImplementation `class`
* This is an open ticket action implementation. * This is an Open Ticket action implementation.
* *
* It is a basic implementation of the `ODWorkerManager` used by all `ODAction` classes. * It is a basic implementation of the `ODWorkerManager` used by all `ODAction` classes.
* *
@@ -28,7 +28,7 @@ export class ODActionImplementation<Source extends string,Params extends object,
} }
/**## ODActionManager `class` /**## ODActionManager `class`
* This is an open ticket action manager. * This is an Open Ticket action manager.
* *
* It contains all Open Ticket actions. You can compare actions with some sort of "procedure". * It contains all Open Ticket actions. You can compare actions with some sort of "procedure".
* It's a complicated task that is divided into multiple functions. * It's a complicated task that is divided into multiple functions.
+15 -15
View File
@@ -21,9 +21,9 @@ export type ODOptionalPromise<T> = T|Promise<T>
export type ODValidButtonColor = "gray"|"red"|"green"|"blue" export type ODValidButtonColor = "gray"|"red"|"green"|"blue"
/**## ODValidId `type` /**## ODValidId `type`
* This is a valid open ticket identifier. It can be an `ODId` or `string`! * This is a valid Open Ticket identifier. It can be an `ODId` or `string`!
* *
* You will see this type in many functions from open ticket. * You will see this type in many functions from Open Ticket.
*/ */
export type ODValidId = string|ODId export type ODValidId = string|ODId
@@ -41,7 +41,7 @@ export type ODValidJsonType = string|number|boolean|object|ODValidJsonType[]|nul
export type ODInterfaceWithPartialProperty<Interface,Key extends keyof Interface> = Omit<Interface,Key> & Partial<Pick<Interface,Key>> export type ODInterfaceWithPartialProperty<Interface,Key extends keyof Interface> = Omit<Interface,Key> & Partial<Pick<Interface,Key>>
/**## ODId `class` /**## ODId `class`
* This is an open ticket identifier. * This is an Open Ticket identifier.
* *
* It can only contain the following characters: `a-z`, `A-Z`, `0-9`, `:`, `-` & `_` * It can only contain the following characters: `a-z`, `A-Z`, `0-9`, `:`, `-` & `_`
* *
@@ -99,7 +99,7 @@ export class ODId {
} }
/**## ODManagerChangeHelper `class` /**## ODManagerChangeHelper `class`
* This is an open ticket manager change helper. * This is an Open Ticket manager change helper.
* *
* It is used to let the "onChange" event in the `ODManager` class work. * It is used to let the "onChange" event in the `ODManager` class work.
* You can use this class when extending your own `ODManager` * You can use this class when extending your own `ODManager`
@@ -124,7 +124,7 @@ export class ODManagerChangeHelper {
} }
/**## ODManagerRedirectHelper `class` /**## ODManagerRedirectHelper `class`
* This is open ticket ticket manager redirect helper. * This is Open Ticket ticket manager redirect helper.
* *
* It is used to redirect a source to another source when the id isn't found. * It is used to redirect a source to another source when the id isn't found.
* *
@@ -163,7 +163,7 @@ export class ODManagerRedirectHelper {
} }
/**## ODManagerData `class` /**## ODManagerData `class`
* This is open ticket manager data. * This is Open Ticket manager data.
* *
* It provides a template for all classes that are used in the `ODManager`. * It provides a template for all classes that are used in the `ODManager`.
* *
@@ -190,7 +190,7 @@ export type ODManagerCallback<DataType extends ODManagerData> = (data:DataType)
export type ODManagerAddCallback<DataType extends ODManagerData> = (data:DataType, overwritten:boolean) => void export type ODManagerAddCallback<DataType extends ODManagerData> = (data:DataType, overwritten:boolean) => void
/**## ODManager `class` /**## ODManager `class`
* This is an open ticket manager. * This is an Open Ticket manager.
* *
* It can be used to store & manage classes based on their `ODId`. * It can be used to store & manage classes based on their `ODId`.
* It is somewhat the same as the default JS `Map()`. * It is somewhat the same as the default JS `Map()`.
@@ -199,7 +199,7 @@ export type ODManagerAddCallback<DataType extends ODManagerData> = (data:DataTyp
* This class has many useful functions based on `ODId` (add, get, remove, getAll, getFiltered, exists, loopAll, ...) * This class has many useful functions based on `ODId` (add, get, remove, getAll, getFiltered, exists, loopAll, ...)
*/ */
export class ODManager<DataType extends ODManagerData> extends ODManagerChangeHelper { export class ODManager<DataType extends ODManagerData> extends ODManagerChangeHelper {
/**Alias to open ticket debugger. */ /**Alias to Open Ticket debugger. */
#debug?: ODDebugger #debug?: ODDebugger
/**The message to send when debugging this manager. */ /**The message to send when debugging this manager. */
#debugname?: string #debugname?: string
@@ -383,7 +383,7 @@ export class ODManager<DataType extends ODManagerData> extends ODManagerChangeHe
await cb(data,data.id) await cb(data,data.id)
} }
} }
/**Use the open ticket debugger in this manager for logs*/ /**Use the Open Ticket debugger in this manager for logs*/
useDebug(debug?:ODDebugger, debugname?:string){ useDebug(debug?:ODDebugger, debugname?:string){
this.#debug = debug this.#debug = debug
this.#debugname = debugname this.#debugname = debugname
@@ -403,7 +403,7 @@ export class ODManager<DataType extends ODManagerData> extends ODManagerChangeHe
} }
/**## ODManagerWithSafety `class` /**## ODManagerWithSafety `class`
* This is an open ticket safe manager. * This is an Open Ticket safe manager.
* *
* It functions exactly the same as a normal `ODManager`, but it has 1 function extra! * It functions exactly the same as a normal `ODManager`, but it has 1 function extra!
* The `getSafe()` function will always return data, because when it doesn't find an id, it returns pre-configured backup data. * The `getSafe()` function will always return data, because when it doesn't find an id, it returns pre-configured backup data.
@@ -435,7 +435,7 @@ export class ODManagerWithSafety<DataType extends ODManagerData> extends ODManag
} }
/**## ODVersionManager `class` /**## ODVersionManager `class`
* A open ticket version manager. * A Open Ticket version manager.
* *
* It is used to manage different `ODVersion`'s from the bot. You will use it to check which version of the bot is used. * It is used to manage different `ODVersion`'s from the bot. You will use it to check which version of the bot is used.
*/ */
@@ -446,11 +446,11 @@ export class ODVersionManager extends ODManager<ODVersion> {
} }
/**## ODVersion `class` /**## ODVersion `class`
* This is an open ticket version. * This is an Open Ticket version.
* *
* It has many features like comparing versions & checking if they are compatible. * It has many features like comparing versions & checking if they are compatible.
* *
* You can use it in your own plugin, but most of the time you will use it to check the open ticket version! * You can use it in your own plugin, but most of the time you will use it to check the Open Ticket version!
*/ */
export class ODVersion extends ODManagerData { export class ODVersion extends ODManagerData {
/**The first number of the version (example: `v1.2.3` => `1`) */ /**The first number of the version (example: `v1.2.3` => `1`) */
@@ -726,7 +726,7 @@ export class ODEnvHelper {
/**## ODSystemError `class` /**## ODSystemError `class`
* A wrapper for the node.js `Error` class that makes the error look better in the console! * A wrapper for the node.js `Error` class that makes the error look better in the console!
* *
* This wrapper is made for open ticket system errors! **It can only be used by open ticket itself!** * This wrapper is made for Open Ticket system errors! **It can only be used by Open Ticket itself!**
*/ */
export class ODSystemError extends Error { export class ODSystemError extends Error {
/**This variable gets detected by the error handling system to know how to render it */ /**This variable gets detected by the error handling system to know how to render it */
@@ -742,7 +742,7 @@ export class ODSystemError extends Error {
/**## ODPluginError `class` /**## ODPluginError `class`
* A wrapper for the node.js `Error` class that makes the error look better in the console! * A wrapper for the node.js `Error` class that makes the error look better in the console!
* *
* This wrapper is made for open ticket plugin errors! **It can only be used by plugins!** * This wrapper is made for Open Ticket plugin errors! **It can only be used by plugins!**
*/ */
export class ODPluginError extends Error { export class ODPluginError extends Error {
/**This variable gets detected by the error handling system to know how to render it */ /**This variable gets detected by the error handling system to know how to render it */
+20 -20
View File
@@ -7,7 +7,7 @@ import { ODWorkerManager, ODWorkerCallback, ODWorker } from "./worker"
import { ODDebugger } from "./console" import { ODDebugger } from "./console"
/**## ODBuilderImplementation `class` /**## ODBuilderImplementation `class`
* This is an open ticket builder implementation. * This is an Open Ticket builder implementation.
* *
* It is a basic implementation of the `ODWorkerManager` used by all `ODBuilder` classes. * It is a basic implementation of the `ODWorkerManager` used by all `ODBuilder` classes.
* *
@@ -48,7 +48,7 @@ export class ODBuilderImplementation<Instance,Source extends string,Params,Build
} }
/**## ODBuilderManager `class` /**## ODBuilderManager `class`
* This is an open ticket builder manager. * This is an Open Ticket builder manager.
* *
* It contains all Open Ticket builders. You can find messages, embeds, files & dropdowns, buttons & modals all here! * It contains all Open Ticket builders. You can find messages, embeds, files & dropdowns, buttons & modals all here!
* *
@@ -96,7 +96,7 @@ export interface ODComponentBuildResult {
} }
/**## ODButtonManager `class` /**## ODButtonManager `class`
* This is an open ticket button manager. * This is an Open Ticket button manager.
* *
* It contains all Open Ticket button builders. Here, you can add your own buttons or edit existing ones! * It contains all Open Ticket button builders. Here, you can add your own buttons or edit existing ones!
* *
@@ -147,7 +147,7 @@ export interface ODButtonData {
} }
/**## ODButtonInstance `class` /**## ODButtonInstance `class`
* This is an open ticket button instance. * This is an Open Ticket button instance.
* *
* It contains all properties & functions to build a button! * It contains all properties & functions to build a button!
*/ */
@@ -201,7 +201,7 @@ export class ODButtonInstance {
} }
/**## ODButton `class` /**## ODButton `class`
* This is an open ticket button builder. * This is an Open Ticket button builder.
* *
* With this class, you can create a button to use in a message. * With this class, you can create a button to use in a message.
* The only difference with normal buttons is that this one can be edited by Open Ticket plugins! * The only difference with normal buttons is that this one can be edited by Open Ticket plugins!
@@ -246,7 +246,7 @@ export class ODButton<Source extends string,Params> extends ODBuilderImplementat
} }
/**## ODDropdownManager `class` /**## ODDropdownManager `class`
* This is an open ticket dropdown manager. * This is an Open Ticket dropdown manager.
* *
* It contains all Open Ticket dropdown builders. Here, you can add your own dropdowns or edit existing ones! * It contains all Open Ticket dropdown builders. Here, you can add your own dropdowns or edit existing ones!
* *
@@ -309,7 +309,7 @@ export interface ODDropdownData {
} }
/**## ODDropdownInstance `class` /**## ODDropdownInstance `class`
* This is an open ticket dropdown instance. * This is an Open Ticket dropdown instance.
* *
* It contains all properties & functions to build a dropdown! * It contains all properties & functions to build a dropdown!
*/ */
@@ -394,7 +394,7 @@ export class ODDropdownInstance {
} }
/**## ODDropdown `class` /**## ODDropdown `class`
* This is an open ticket dropdown builder. * This is an Open Ticket dropdown builder.
* *
* With this class, you can create a dropdown to use in a message. * With this class, you can create a dropdown to use in a message.
* The only difference with normal dropdowns is that this one can be edited by Open Ticket plugins! * The only difference with normal dropdowns is that this one can be edited by Open Ticket plugins!
@@ -500,7 +500,7 @@ export class ODDropdown<Source extends string,Params> extends ODBuilderImplement
} }
/**## ODFileManager `class` /**## ODFileManager `class`
* This is an open ticket file manager. * This is an Open Ticket file manager.
* *
* It contains all Open Ticket file builders. Here, you can add your own files or edit existing ones! * It contains all Open Ticket file builders. Here, you can add your own files or edit existing ones!
* *
@@ -544,7 +544,7 @@ export interface ODFileBuildResult {
} }
/**## ODFileInstance `class` /**## ODFileInstance `class`
* This is an open ticket file instance. * This is an Open Ticket file instance.
* *
* It contains all properties & functions to build a file! * It contains all properties & functions to build a file!
*/ */
@@ -585,7 +585,7 @@ export class ODFileInstance {
} }
/**## ODFile `class` /**## ODFile `class`
* This is an open ticket file builder. * This is an Open Ticket file builder.
* *
* With this class, you can create a file to use in a message. * With this class, you can create a file to use in a message.
* The only difference with normal files is that this one can be edited by Open Ticket plugins! * The only difference with normal files is that this one can be edited by Open Ticket plugins!
@@ -623,7 +623,7 @@ export class ODFile<Source extends string,Params> extends ODBuilderImplementatio
} }
/**## ODEmbedManager `class` /**## ODEmbedManager `class`
* This is an open ticket embed manager. * This is an Open Ticket embed manager.
* *
* It contains all Open Ticket embed builders. Here, you can add your own embeds or edit existing ones! * It contains all Open Ticket embed builders. Here, you can add your own embeds or edit existing ones!
* *
@@ -686,7 +686,7 @@ export interface ODEmbedBuildResult {
} }
/**## ODEmbedInstance `class` /**## ODEmbedInstance `class`
* This is an open ticket embed instance. * This is an Open Ticket embed instance.
* *
* It contains all properties & functions to build an embed! * It contains all properties & functions to build an embed!
*/ */
@@ -786,7 +786,7 @@ export class ODEmbedInstance {
} }
/**## ODEmbed `class` /**## ODEmbed `class`
* This is an open ticket embed builder. * This is an Open Ticket embed builder.
* *
* With this class, you can create a embed to use in a message. * With this class, you can create a embed to use in a message.
* The only difference with normal embeds is that this one can be edited by Open Ticket plugins! * The only difference with normal embeds is that this one can be edited by Open Ticket plugins!
@@ -837,7 +837,7 @@ export class ODEmbed<Source extends string,Params> extends ODBuilderImplementati
} }
/**## ODMessageManager `class` /**## ODMessageManager `class`
* This is an open ticket message manager. * This is an Open Ticket message manager.
* *
* It contains all Open Ticket message builders. Here, you can add your own messages or edit existing ones! * It contains all Open Ticket message builders. Here, you can add your own messages or edit existing ones!
* *
@@ -899,7 +899,7 @@ export interface ODMessageBuildSentResult<InGuild extends boolean> {
} }
/**## ODMessageInstance `class` /**## ODMessageInstance `class`
* This is an open ticket message instance. * This is an Open Ticket message instance.
* *
* It contains all properties & functions to build a message! * It contains all properties & functions to build a message!
*/ */
@@ -1002,7 +1002,7 @@ export class ODMessageInstance {
} }
/**## ODMessage `class` /**## ODMessage `class`
* This is an open ticket message builder. * This is an Open Ticket message builder.
* *
* With this class, you can create a message to send in a discord channel. * With this class, you can create a message to send in a discord channel.
* The only difference with normal messages is that this one can be edited by Open Ticket plugins! * The only difference with normal messages is that this one can be edited by Open Ticket plugins!
@@ -1078,7 +1078,7 @@ export class ODMessage<Source extends string,Params> extends ODBuilderImplementa
} }
/**## ODModalManager `class` /**## ODModalManager `class`
* This is an open ticket modal manager. * This is an Open Ticket modal manager.
* *
* It contains all Open Ticket modal builders. Here, you can add your own modals or edit existing ones! * It contains all Open Ticket modal builders. Here, you can add your own modals or edit existing ones!
* *
@@ -1149,7 +1149,7 @@ export interface ODModalBuildResult {
} }
/**## ODModalInstance `class` /**## ODModalInstance `class`
* This is an open ticket modal instance. * This is an Open Ticket modal instance.
* *
* It contains all properties & functions to build a modal! * It contains all properties & functions to build a modal!
*/ */
@@ -1196,7 +1196,7 @@ export class ODModalInstance {
} }
/**## ODModal `class` /**## ODModal `class`
* This is an open ticket modal builder. * This is an Open Ticket modal builder.
* *
* With this class, you can create a modal to use as response in interactions. * With this class, you can create a modal to use as response in interactions.
* The only difference with normal modals is that this one can be edited by Open Ticket plugins! * The only difference with normal modals is that this one can be edited by Open Ticket plugins!
+27 -27
View File
@@ -15,9 +15,9 @@ export interface ODCheckerResult {
} }
/**## ODCheckerManager `class` /**## ODCheckerManager `class`
* This is an open ticket checker manager. * This is an Open Ticket checker manager.
* *
* It manages all config checkers in the bot and allows plugins to access config checkers from open ticket & other plugins! * It manages all config checkers in the bot and allows plugins to access config checkers from Open Ticket & other plugins!
* *
* You can use this class to get/add a config checker (`ODChecker`) in your plugin! * You can use this class to get/add a config checker (`ODChecker`) in your plugin!
* @example * @example
@@ -93,7 +93,7 @@ export class ODCheckerManager extends ODManager<ODChecker> {
} }
/**## ODCheckerStorage `class` /**## ODCheckerStorage `class`
* This is an open ticket checker storage. * This is an Open Ticket checker storage.
* *
* It stores temporary data to share between config checkers! * It stores temporary data to share between config checkers!
* (e.g. The `messages.json` needs to access the `"id"` from `options.json`) * (e.g. The `messages.json` needs to access the `"id"` from `options.json`)
@@ -145,7 +145,7 @@ export class ODCheckerStorage {
} }
/**## ODCheckerRenderer `class` /**## ODCheckerRenderer `class`
* This is an open ticket checker renderer. * This is an Open Ticket checker renderer.
* *
* It's responsible for rendering the config checker result in the console. * It's responsible for rendering the config checker result in the console.
* This class doesn't provide any components! You need to create them by extending this class * This class doesn't provide any components! You need to create them by extending this class
@@ -169,7 +169,7 @@ export class ODCheckerRenderer {
} }
/**## ODCheckerTranslationRegister `class` /**## ODCheckerTranslationRegister `class`
* This is an open ticket checker translation register. * This is an Open Ticket checker translation register.
* *
* It's used to store & manage the translation for each message from the config checker! * It's used to store & manage the translation for each message from the config checker!
* Most translations are stored by message id, but there are some exceptions like the additional text on the checker report. * Most translations are stored by message id, but there are some exceptions like the additional text on the checker report.
@@ -227,7 +227,7 @@ export class ODCheckerTranslationRegister {
} }
/**## ODCheckerFunction `class` /**## ODCheckerFunction `class`
* This is an open ticket config checker function. * This is an Open Ticket config checker function.
* *
* It is a global function that will be executed after all config checkers. It can do additional checks for invalid/missing configurations. * It is a global function that will be executed after all config checkers. It can do additional checks for invalid/missing configurations.
* It's mostly used for things that need to be checked globally! * It's mostly used for things that need to be checked globally!
@@ -243,7 +243,7 @@ export class ODCheckerFunction extends ODManagerData {
} }
/**## ODCheckerFunctionManager `class` /**## ODCheckerFunctionManager `class`
* This is an open ticket config checker function manager. * This is an Open Ticket config checker function manager.
* *
* It manages all `ODCheckerFunction`'s and it has some extra shortcuts for frequently used methods. * It manages all `ODCheckerFunction`'s and it has some extra shortcuts for frequently used methods.
*/ */
@@ -293,7 +293,7 @@ export class ODCheckerFunctionManager extends ODManager<ODCheckerFunction> {
export type ODCheckerLocationTrace = (string|number)[] export type ODCheckerLocationTrace = (string|number)[]
/**## ODChecker `class` /**## ODChecker `class`
* This is an open ticket config checker. * This is an Open Ticket config checker.
* *
* It checks a specific config file for invalid/missing configurations. This data can then be used to show to the user what's wrong! * It checks a specific config file for invalid/missing configurations. This data can then be used to show to the user what's wrong!
* You can check for example if a string is longer/shorter than a certain amount of characters & more! * You can check for example if a string is longer/shorter than a certain amount of characters & more!
@@ -405,7 +405,7 @@ export interface ODCheckerStructureOptions {
} }
/**## ODCheckerStructure `class` /**## ODCheckerStructure `class`
* This is an open ticket config checker structure. * This is an Open Ticket config checker structure.
* *
* This class will check for a single variable in a config file, customise it in the settings! * This class will check for a single variable in a config file, customise it in the settings!
* If you want prebuilt checkers (for strings, booleans, numbers, ...), check the other `ODCheckerStructure`'s! * If you want prebuilt checkers (for strings, booleans, numbers, ...), check the other `ODCheckerStructure`'s!
@@ -423,7 +423,7 @@ export class ODCheckerStructure {
this.options = options this.options = options
} }
/**Check a variable if it matches all settings in this checker. This function is automatically executed by open ticket! */ /**Check a variable if it matches all settings in this checker. This function is automatically executed by Open Ticket! */
check(checker:ODChecker, value:ODValidJsonType, locationTrace:ODCheckerLocationTrace): boolean { check(checker:ODChecker, value:ODValidJsonType, locationTrace:ODCheckerLocationTrace): boolean {
if (typeof this.options.custom != "undefined"){ if (typeof this.options.custom != "undefined"){
return this.options.custom(checker,value,locationTrace,this.id,(this.options.docs ?? null)) return this.options.custom(checker,value,locationTrace,this.id,(this.options.docs ?? null))
@@ -440,7 +440,7 @@ export interface ODCheckerObjectStructureOptions extends ODCheckerStructureOptio
} }
/**## ODCheckerObjectStructure `class` /**## ODCheckerObjectStructure `class`
* This is an open ticket config checker structure. * This is an Open Ticket config checker structure.
* *
* This class will check for an object variable in a config file, customise it in the settings! * This class will check for an object variable in a config file, customise it in the settings!
* A checker for the children can be set in the settings. * A checker for the children can be set in the settings.
@@ -514,7 +514,7 @@ export interface ODCheckerStringStructureOptions extends ODCheckerStructureOptio
} }
/**## ODCheckerStringStructure `class` /**## ODCheckerStringStructure `class`
* This is an open ticket config checker structure. * This is an Open Ticket config checker structure.
* *
* This class will check for a string variable in a config file, customise it in the settings! * This class will check for a string variable in a config file, customise it in the settings!
*/ */
@@ -599,7 +599,7 @@ export interface ODCheckerNumberStructureOptions extends ODCheckerStructureOptio
} }
/**## ODCheckerNumberStructure `class` /**## ODCheckerNumberStructure `class`
* This is an open ticket config checker structure. * This is an Open Ticket config checker structure.
* *
* This class will check for a number variable in a config file, customise it in the settings! * This class will check for a number variable in a config file, customise it in the settings!
*/ */
@@ -681,7 +681,7 @@ export interface ODCheckerBooleanStructureOptions extends ODCheckerStructureOpti
} }
/**## ODCheckerBooleanStructure `class` /**## ODCheckerBooleanStructure `class`
* This is an open ticket config checker structure. * This is an Open Ticket config checker structure.
* *
* This class will check for a boolean variable in a config file, customise it in the settings! * This class will check for a boolean variable in a config file, customise it in the settings!
*/ */
@@ -732,7 +732,7 @@ export interface ODCheckerArrayStructureOptions extends ODCheckerStructureOption
} }
/**## ODCheckerArrayStructure `class` /**## ODCheckerArrayStructure `class`
* This is an open ticket config checker structure. * This is an Open Ticket config checker structure.
* *
* This class will check for an array variable in a config file, customise it in the settings! * This class will check for an array variable in a config file, customise it in the settings!
*/ */
@@ -835,7 +835,7 @@ export interface ODCheckerNullStructureOptions extends ODCheckerStructureOptions
} }
/**## ODCheckerNullStructure `class` /**## ODCheckerNullStructure `class`
* This is an open ticket config checker structure. * This is an Open Ticket config checker structure.
* *
* This class will check for a null variable in a config file, customise it in the settings! * This class will check for a null variable in a config file, customise it in the settings!
*/ */
@@ -885,7 +885,7 @@ export interface ODCheckerTypeSwitchStructureOptions extends ODCheckerStructureO
} }
/**## ODCheckerTypeSwitchStructure `class` /**## ODCheckerTypeSwitchStructure `class`
* This is an open ticket config checker structure. * This is an Open Ticket config checker structure.
* *
* This class will switch checkers based on the type of the variable in a config file, customise it in the settings! * This class will switch checkers based on the type of the variable in a config file, customise it in the settings!
*/ */
@@ -948,7 +948,7 @@ export interface ODCheckerObjectSwitchStructureOptions extends ODCheckerStructur
} }
/**## ODCheckerObjectSwitchStructure `class` /**## ODCheckerObjectSwitchStructure `class`
* This is an open ticket config checker structure. * This is an Open Ticket config checker structure.
* *
* This class will switch object checkers based on a variable match in one of the objects, customise it in the settings! * This class will switch object checkers based on a variable match in one of the objects, customise it in the settings!
*/ */
@@ -1011,7 +1011,7 @@ export interface ODCheckerEnabledObjectStructureOptions extends ODCheckerStructu
} }
/**## ODCheckerEnabledObjectStructure `class` /**## ODCheckerEnabledObjectStructure `class`
* This is an open ticket config checker structure. * This is an Open Ticket config checker structure.
* *
* This class will enable an object checker based on a variable match in the object, customise it in the settings! * This class will enable an object checker based on a variable match in the object, customise it in the settings!
*/ */
@@ -1049,7 +1049,7 @@ export class ODCheckerEnabledObjectStructure extends ODCheckerStructure {
} }
/**## ODCheckerCustomStructure_DiscordId `class` /**## ODCheckerCustomStructure_DiscordId `class`
* This is an open ticket custom checker structure. * This is an Open Ticket custom checker structure.
* *
* This class extends a primitive config checker & adds another layer of checking in the `custom` function. * This class extends a primitive config checker & adds another layer of checking in the `custom` function.
* You can compare it to a blueprint for a specific checker. * You can compare it to a blueprint for a specific checker.
@@ -1089,7 +1089,7 @@ export class ODCheckerCustomStructure_DiscordId extends ODCheckerStringStructure
} }
/**## ODCheckerCustomStructure_DiscordIdArray `class` /**## ODCheckerCustomStructure_DiscordIdArray `class`
* This is an open ticket custom checker structure. * This is an Open Ticket custom checker structure.
* *
* This class extends a primitive config checker & adds another layer of checking in the `custom` function. * This class extends a primitive config checker & adds another layer of checking in the `custom` function.
* You can compare it to a blueprint for a specific checker. * You can compare it to a blueprint for a specific checker.
@@ -1113,7 +1113,7 @@ export class ODCheckerCustomStructure_DiscordIdArray extends ODCheckerArrayStruc
} }
/**## ODCheckerCustomStructure_DiscordToken `class` /**## ODCheckerCustomStructure_DiscordToken `class`
* This is an open ticket custom checker structure. * This is an Open Ticket custom checker structure.
* *
* This class extends a primitive config checker & adds another layer of checking in the `custom` function. * This class extends a primitive config checker & adds another layer of checking in the `custom` function.
* You can compare it to a blueprint for a specific checker. * You can compare it to a blueprint for a specific checker.
@@ -1138,7 +1138,7 @@ export class ODCheckerCustomStructure_DiscordToken extends ODCheckerStringStruct
} }
/**## ODCheckerCustomStructure_DiscordToken `class` /**## ODCheckerCustomStructure_DiscordToken `class`
* This is an open ticket custom checker structure. * This is an Open Ticket custom checker structure.
* *
* This class extends a primitive config checker & adds another layer of checking in the `custom` function. * This class extends a primitive config checker & adds another layer of checking in the `custom` function.
* You can compare it to a blueprint for a specific checker. * You can compare it to a blueprint for a specific checker.
@@ -1172,7 +1172,7 @@ export class ODCheckerCustomStructure_HexColor extends ODCheckerStringStructure
} }
/**## ODCheckerCustomStructure_EmojiString `class` /**## ODCheckerCustomStructure_EmojiString `class`
* This is an open ticket custom checker structure. * This is an Open Ticket custom checker structure.
* *
* This class extends a primitive config checker & adds another layer of checking in the `custom` function. * This class extends a primitive config checker & adds another layer of checking in the `custom` function.
* You can compare it to a blueprint for a specific checker. * You can compare it to a blueprint for a specific checker.
@@ -1239,7 +1239,7 @@ export interface ODCheckerCustomStructureOptions_UrlString {
} }
/**## ODCheckerCustomStructure_UrlString `class` /**## ODCheckerCustomStructure_UrlString `class`
* This is an open ticket custom checker structure. * This is an Open Ticket custom checker structure.
* *
* This class extends a primitive config checker & adds another layer of checking in the `custom` function. * This class extends a primitive config checker & adds another layer of checking in the `custom` function.
* You can compare it to a blueprint for a specific checker. * You can compare it to a blueprint for a specific checker.
@@ -1343,7 +1343,7 @@ export class ODCheckerCustomStructure_UrlString extends ODCheckerStringStructure
} }
/**## ODCheckerCustomStructure_UniqueId `class` /**## ODCheckerCustomStructure_UniqueId `class`
* This is an open ticket custom checker structure. * This is an Open Ticket custom checker structure.
* *
* This class extends a primitive config checker & adds another layer of checking in the `custom` function. * This class extends a primitive config checker & adds another layer of checking in the `custom` function.
* You can compare it to a blueprint for a specific checker. * You can compare it to a blueprint for a specific checker.
@@ -1382,7 +1382,7 @@ export class ODCheckerCustomStructure_UniqueId extends ODCheckerStringStructure
} }
/**## ODCheckerCustomStructure_UniqueIdArray `class` /**## ODCheckerCustomStructure_UniqueIdArray `class`
* This is an open ticket custom checker structure. * This is an Open Ticket custom checker structure.
* *
* This class extends a primitive config checker & adds another layer of checking in the `custom` function. * This class extends a primitive config checker & adds another layer of checking in the `custom` function.
* You can compare it to a blueprint for a specific checker. * You can compare it to a blueprint for a specific checker.
+11 -11
View File
@@ -26,14 +26,14 @@ export type ODClientPartials = ("User"|"Channel"|"GuildMember"|"Message"|"Reacti
export type ODClientPermissions = ("CreateInstantInvite"|"KickMembers"|"BanMembers"|"Administrator"|"ManageChannels"|"ManageGuild"|"AddReactions"|"ViewAuditLog"|"PrioritySpeaker"|"Stream"|"ViewChannel"|"SendMessages"|"SendTTSMessages"|"ManageMessages"|"EmbedLinks"|"AttachFiles"|"ReadMessageHistory"|"MentionEveryone"|"UseExternalEmojis"|"ViewGuildInsights"|"Connect"|"Speak"|"MuteMembers"|"DeafenMembers"|"MoveMembers"|"UseVAD"|"ChangeNickname"|"ManageNicknames"|"ManageRoles"|"ManageWebhooks"|"ManageGuildExpressions"|"UseApplicationCommands"|"RequestToSpeak"|"ManageEvents"|"ManageThreads"|"CreatePublicThreads"|"CreatePrivateThreads"|"UseExternalStickers"|"SendMessagesInThreads"|"UseEmbeddedActivities"|"ModerateMembers"|"ViewCreatorMonetizationAnalytics"|"UseSoundboard"|"UseExternalSounds"|"SendVoiceMessages") export type ODClientPermissions = ("CreateInstantInvite"|"KickMembers"|"BanMembers"|"Administrator"|"ManageChannels"|"ManageGuild"|"AddReactions"|"ViewAuditLog"|"PrioritySpeaker"|"Stream"|"ViewChannel"|"SendMessages"|"SendTTSMessages"|"ManageMessages"|"EmbedLinks"|"AttachFiles"|"ReadMessageHistory"|"MentionEveryone"|"UseExternalEmojis"|"ViewGuildInsights"|"Connect"|"Speak"|"MuteMembers"|"DeafenMembers"|"MoveMembers"|"UseVAD"|"ChangeNickname"|"ManageNicknames"|"ManageRoles"|"ManageWebhooks"|"ManageGuildExpressions"|"UseApplicationCommands"|"RequestToSpeak"|"ManageEvents"|"ManageThreads"|"CreatePublicThreads"|"CreatePrivateThreads"|"UseExternalStickers"|"SendMessagesInThreads"|"UseEmbeddedActivities"|"ModerateMembers"|"ViewCreatorMonetizationAnalytics"|"UseSoundboard"|"UseExternalSounds"|"SendVoiceMessages")
/**## ODClientManager `class` /**## ODClientManager `class`
* This is an open ticket client manager. * This is an Open Ticket client manager.
* *
* It is responsible for managing the discord.js client. Here, you can set the status, register slash commands and much more! * It is responsible for managing the discord.js client. Here, you can set the status, register slash commands and much more!
* *
* If you want, you can also listen for custom events on the `ODClientManager.client` variable (`discord.Client`) * If you want, you can also listen for custom events on the `ODClientManager.client` variable (`discord.Client`)
*/ */
export class ODClientManager { export class ODClientManager {
/**Alias to open ticket debugger. */ /**Alias to Open Ticket debugger. */
#debug: ODDebugger #debug: ODDebugger
/**List of required bot intents. Add intents to this list using the `onClientLoad` event. */ /**List of required bot intents. Add intents to this list using the `onClientLoad` event. */
@@ -68,7 +68,7 @@ export class ODClientManager {
/**The main server of the bot. Provided by serverId in the config */ /**The main server of the bot. Provided by serverId in the config */
mainServer: discord.Guild|null = null mainServer: discord.Guild|null = null
/**(❌ DO NOD OVERWRITE ❌) Internal open ticket function to continue the startup when the client is ready! */ /**(❌ DO NOD OVERWRITE ❌) Internal Open Ticket function to continue the startup when the client is ready! */
readyListener: (() => Promise<void>)|null = null readyListener: (() => Promise<void>)|null = null
/**The status manager is responsible for setting the bot status. */ /**The status manager is responsible for setting the bot status. */
activity: ODClientActivityManager activity: ODClientActivityManager
@@ -333,14 +333,14 @@ export type ODClientActivityStatus = ("online"|"invisible"|"idle"|"dnd")
/**## ODClientActivityManager `class` /**## ODClientActivityManager `class`
* This is an open ticket client activity manager. * This is an Open Ticket client activity manager.
* *
* It's responsible for managing the client status. Here, you can set the activity & status of the bot. * It's responsible for managing the client status. Here, you can set the activity & status of the bot.
* *
* It also has a built-in refresh function, so the status will refresh every 10 minutes to keep it visible. * It also has a built-in refresh function, so the status will refresh every 10 minutes to keep it visible.
*/ */
export class ODClientActivityManager { export class ODClientActivityManager {
/**Alias to open ticket debugger. */ /**Alias to Open Ticket debugger. */
#debug: ODDebugger #debug: ODDebugger
/**Copy of discord.js client */ /**Copy of discord.js client */
@@ -765,14 +765,14 @@ export type ODSlashCommandRegisteredResult = {
} }
/**## ODSlashCommandManager `class` /**## ODSlashCommandManager `class`
* This is an open ticket client slash manager. * This is an Open Ticket client slash manager.
* *
* It's responsible for managing all the slash commands from the client. * It's responsible for managing all the slash commands from the client.
* *
* Here, you can add & remove slash commands & the bot will do the (de)registering. * Here, you can add & remove slash commands & the bot will do the (de)registering.
*/ */
export class ODSlashCommandManager extends ODManager<ODSlashCommand> { export class ODSlashCommandManager extends ODManager<ODSlashCommand> {
/**Alias to open ticket debugger. */ /**Alias to Open Ticket debugger. */
#debug: ODDebugger #debug: ODDebugger
/**Refrerence to discord.js client. */ /**Refrerence to discord.js client. */
@@ -933,7 +933,7 @@ export class ODSlashCommandManager extends ODManager<ODSlashCommand> {
export type ODSlashCommandUpdateFunction = (command:ODSlashCommandUniversalCommand) => boolean export type ODSlashCommandUpdateFunction = (command:ODSlashCommandUniversalCommand) => boolean
/**## ODSlashCommand `class` /**## ODSlashCommand `class`
* This is an open ticket slash command. * This is an Open Ticket slash command.
* *
* When registered, you can listen for this command using the `ODCommandResponder`. The advantages of using this class for creating a slash command are: * When registered, you can listen for this command using the `ODCommandResponder`. The advantages of using this class for creating a slash command are:
* - automatic option parsing (even for channels, users, roles & mentions)! * - automatic option parsing (even for channels, users, roles & mentions)!
@@ -1106,7 +1106,7 @@ export interface ODTextCommandBuilder {
} }
/**## ODTextCommand `class` /**## ODTextCommand `class`
* This is an open ticket text command. * This is an Open Ticket text command.
* *
* When registered, you can listen for this command using the `ODCommandResponder`. The advantages of using this class for creating a text command are: * When registered, you can listen for this command using the `ODCommandResponder`. The advantages of using this class for creating a text command are:
* - automatic option parsing (even for channels, users, roles & mentions)! * - automatic option parsing (even for channels, users, roles & mentions)!
@@ -1263,14 +1263,14 @@ export type ODTextCommandError = (
export type ODTextCommandErrorCallback = (error:ODTextCommandError) => void export type ODTextCommandErrorCallback = (error:ODTextCommandError) => void
/**## ODTextCommandManager `class` /**## ODTextCommandManager `class`
* This is an open ticket client text manager. * This is an Open Ticket client text manager.
* *
* It's responsible for managing all the text commands from the client. * It's responsible for managing all the text commands from the client.
* *
* Here, you can add & remove text commands & the bot will do the (de)registering. * Here, you can add & remove text commands & the bot will do the (de)registering.
*/ */
export class ODTextCommandManager extends ODManager<ODTextCommand> { export class ODTextCommandManager extends ODManager<ODTextCommand> {
/**Alias to open ticket debugger. */ /**Alias to Open Ticket debugger. */
#debug: ODDebugger #debug: ODDebugger
/**Copy of discord.js client. */ /**Copy of discord.js client. */
manager: ODClientManager manager: ODClientManager
+2 -2
View File
@@ -6,7 +6,7 @@ import { ODDebugger } from "./console"
/**## ODCode `class` /**## ODCode `class`
* This is an open ticket code runner. * This is an Open Ticket code runner.
* *
* Using this, you're able to execute a function just before the startup screen. (90% of the code is already loaded) * Using this, you're able to execute a function just before the startup screen. (90% of the code is already loaded)
* You can also specify a priority to change the execution order. * You can also specify a priority to change the execution order.
@@ -31,7 +31,7 @@ export class ODCode extends ODManagerData {
} }
/**## ODCodeManager `class` /**## ODCodeManager `class`
* This is an open ticket code manager. * This is an Open Ticket code manager.
* *
* It manages & executes `ODCode`'s in the correct order. * It manages & executes `ODCode`'s in the correct order.
* *
+3 -3
View File
@@ -7,7 +7,7 @@ import { ODDebugger } from "./console"
import fs from "fs" import fs from "fs"
/**## ODConfigManager `class` /**## ODConfigManager `class`
* This is an open ticket config manager. * This is an Open Ticket config manager.
* *
* It manages all config files in the bot and allows plugins to access config files from Open Ticket & other plugins! * It manages all config files in the bot and allows plugins to access config files from Open Ticket & other plugins!
* *
@@ -30,7 +30,7 @@ export class ODConfigManager extends ODManager<ODConfig> {
} }
/**## ODConfig `class` /**## ODConfig `class`
* This is an open ticket config helper. * This is an Open Ticket config helper.
* This class doesn't do anything at all, it just gives a template & basic methods for a config. Use `ODJsonConfig` instead! * This class doesn't do anything at all, it just gives a template & basic methods for a config. Use `ODJsonConfig` instead!
* *
* You can use this class if you want to create your own config implementation (e.g. `yml`, `xml`,...)! * You can use this class if you want to create your own config implementation (e.g. `yml`, `xml`,...)!
@@ -55,7 +55,7 @@ export class ODConfig extends ODManagerData {
} }
/**## ODJsonConfig `class` /**## ODJsonConfig `class`
* This is an open ticket JSON config. * This is an Open Ticket JSON config.
* You can use this class to get & edit variables from the config files or to create your own JSON config! * You can use this class to get & edit variables from the config files or to create your own JSON config!
* @example * @example
* //create a config from: ./config/test.json with the id "some-config" * //create a config from: ./config/test.json with the id "some-config"
+17 -17
View File
@@ -25,7 +25,7 @@ export interface ODConsoleMessageParam {
} }
/**## ODConsoleMessage `class` /**## ODConsoleMessage `class`
* This is an open ticket console message. * This is an Open Ticket console message.
* *
* It is used to create beautiful & styled logs in the console with a prefix, message & parameters. * It is used to create beautiful & styled logs in the console with a prefix, message & parameters.
* It also has full color support using `ansis` and parameters are parsed for you! * It also has full color support using `ansis` and parameters are parsed for you!
@@ -117,7 +117,7 @@ export class ODConsoleMessage {
} }
/**## ODConsoleInfoMessage `class` /**## ODConsoleInfoMessage `class`
* This is an open ticket console info message. * This is an Open Ticket console info message.
* *
* It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "INFO" messages! * It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "INFO" messages!
*/ */
@@ -128,7 +128,7 @@ export class ODConsoleInfoMessage extends ODConsoleMessage {
} }
/**## ODConsoleSystemMessage `class` /**## ODConsoleSystemMessage `class`
* This is an open ticket console system message. * This is an Open Ticket console system message.
* *
* It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "SYSTEM" messages! * It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "SYSTEM" messages!
*/ */
@@ -139,7 +139,7 @@ export class ODConsoleSystemMessage extends ODConsoleMessage {
} }
/**## ODConsolePluginMessage `class` /**## ODConsolePluginMessage `class`
* This is an open ticket console plugin message. * This is an Open Ticket console plugin message.
* *
* It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "PLUGIN" messages! * It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "PLUGIN" messages!
*/ */
@@ -150,7 +150,7 @@ export class ODConsolePluginMessage extends ODConsoleMessage {
} }
/**## ODConsoleDebugMessage `class` /**## ODConsoleDebugMessage `class`
* This is an open ticket console debug message. * This is an Open Ticket console debug message.
* *
* It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "DEBUG" messages! * It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "DEBUG" messages!
*/ */
@@ -161,7 +161,7 @@ export class ODConsoleDebugMessage extends ODConsoleMessage {
} }
/**## ODConsoleWarningMessage `class` /**## ODConsoleWarningMessage `class`
* This is an open ticket console warning message. * This is an Open Ticket console warning message.
* *
* It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "WARNING" messages! * It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "WARNING" messages!
*/ */
@@ -172,7 +172,7 @@ export class ODConsoleWarningMessage extends ODConsoleMessage {
} }
/**## ODConsoleErrorMessage `class` /**## ODConsoleErrorMessage `class`
* This is an open ticket console error message. * This is an Open Ticket console error message.
* *
* It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "ERROR" messages! * It is the same as a normal `ODConsoleMessage`, but it has a predefined prefix & color scheme for the "ERROR" messages!
*/ */
@@ -183,7 +183,7 @@ export class ODConsoleErrorMessage extends ODConsoleMessage {
} }
/**## ODError `class` /**## ODError `class`
* This is an open ticket error. * This is an Open Ticket error.
* *
* It is used to render and log Node.js errors & crashes in a styled way to the console & `otdebug.txt` file! * It is used to render and log Node.js errors & crashes in a styled way to the console & `otdebug.txt` file!
*/ */
@@ -227,7 +227,7 @@ export class ODError {
export type ODConsoleMessageTypes = "info"|"system"|"plugin"|"debug"|"warning"|"error" export type ODConsoleMessageTypes = "info"|"system"|"plugin"|"debug"|"warning"|"error"
/**## ODConsoleManager `class` /**## ODConsoleManager `class`
* This is the open ticket console manager. * This is the Open Ticket console manager.
* *
* It handles the entire console system of Open Ticket. It's also the place where you need to log `ODConsoleMessage`'s. * It handles the entire console system of Open Ticket. It's also the place where you need to log `ODConsoleMessage`'s.
* This manager keeps a short history of messages sent to the console which is configurable by plugins. * This manager keeps a short history of messages sent to the console which is configurable by plugins.
@@ -285,7 +285,7 @@ export class ODConsoleManager {
} }
/**## ODDebugFileManager `class` /**## ODDebugFileManager `class`
* This is the open ticket debug file manager. * This is the Open Ticket debug file manager.
* *
* It manages the Open Ticket debug file (`otdebug.txt`) which keeps a history of all system logs. * It manages the Open Ticket debug file (`otdebug.txt`) which keeps a history of all system logs.
* There are even internal logs that aren't logged to the console which are available in this file! * There are even internal logs that aren't logged to the console which are available in this file!
@@ -398,7 +398,7 @@ export class ODDebugFileManager {
} }
/**## ODDebugger `class` /**## ODDebugger `class`
* This is the open ticket debugger. * This is the Open Ticket debugger.
* *
* It is a simple wrapper around the `ODConsoleManager` to handle debugging (primarily for `ODManagers`). * It is a simple wrapper around the `ODConsoleManager` to handle debugging (primarily for `ODManagers`).
* Messages created using this debugger are only logged to the debug file unless specified otherwise. * Messages created using this debugger are only logged to the debug file unless specified otherwise.
@@ -408,7 +408,7 @@ export class ODDebugFileManager {
* Using this system, all additions & removals inside a manager are logged to the debug file. This makes searching for errors a lot easier! * Using this system, all additions & removals inside a manager are logged to the debug file. This makes searching for errors a lot easier!
*/ */
export class ODDebugger { export class ODDebugger {
/**An alias to the open ticket console manager. */ /**An alias to the Open Ticket console manager. */
console: ODConsoleManager console: ODConsoleManager
/**When enabled, debug logs are also shown in the console. */ /**When enabled, debug logs are also shown in the console. */
visible: boolean = false visible: boolean = false
@@ -475,7 +475,7 @@ export interface ODLiveStatusSourceData {
} }
/**## ODLiveStatusSource `class` /**## ODLiveStatusSource `class`
* This is the open ticket livestatus source. * This is the Open Ticket livestatus source.
* *
* It is an empty template for a livestatus source. * It is an empty template for a livestatus source.
* By default, you should use `ODLiveStatusUrlSource` or `ODLiveStatusFileSource`, * By default, you should use `ODLiveStatusUrlSource` or `ODLiveStatusFileSource`,
@@ -526,7 +526,7 @@ export class ODLiveStatusSource extends ODManagerData {
} }
/**## ODLiveStatusFileSource `class` /**## ODLiveStatusFileSource `class`
* This is the open ticket livestatus file source. * This is the Open Ticket livestatus file source.
* *
* It is a LiveStatus source that will read the data from a local file. * It is a LiveStatus source that will read the data from a local file.
* *
@@ -545,7 +545,7 @@ export class ODLiveStatusFileSource extends ODLiveStatusSource {
} }
/**## ODLiveStatusUrlSource `class` /**## ODLiveStatusUrlSource `class`
* This is the open ticket livestatus url source. * This is the Open Ticket livestatus url source.
* *
* It is a LiveStatus source that will read the data from a http URL (json file). * It is a LiveStatus source that will read the data from a http URL (json file).
* *
@@ -579,7 +579,7 @@ export class ODLiveStatusUrlSource extends ODLiveStatusSource {
} }
/**## ODLiveStatusManager `class` /**## ODLiveStatusManager `class`
* This is the open ticket livestatus manager. * This is the Open Ticket livestatus manager.
* *
* It manages all LiveStatus sources and has the renderer for all LiveStatus messages. * It manages all LiveStatus sources and has the renderer for all LiveStatus messages.
* *
@@ -611,7 +611,7 @@ export class ODLiveStatusManager extends ODManager<ODLiveStatusSource> {
} }
/**## ODLiveStatusRenderer `class` /**## ODLiveStatusRenderer `class`
* This is the open ticket livestatus renderer. * This is the Open Ticket livestatus renderer.
* *
* It's responsible for rendering all LiveStatus messages to the console. * It's responsible for rendering all LiveStatus messages to the console.
*/ */
+7 -7
View File
@@ -5,7 +5,7 @@ import { ODId, ODValidId, ODManager, ODSystemError, ODManagerData } from "./base
import { ODDebugger } from "./console" import { ODDebugger } from "./console"
/**## ODCooldownManager `class` /**## ODCooldownManager `class`
* This is an open ticket cooldown manager. * This is an Open Ticket cooldown manager.
* *
* It is responsible for managing all cooldowns in Open Ticket. An example of this is the ticket creation cooldown. * It is responsible for managing all cooldowns in Open Ticket. An example of this is the ticket creation cooldown.
* *
@@ -24,7 +24,7 @@ export class ODCooldownManager extends ODManager<ODCooldown<object>> {
} }
/**## ODCooldownData `class` /**## ODCooldownData `class`
* This is open ticket cooldown data. * This is Open Ticket cooldown data.
* *
* It contains the instance of an active cooldown (e.g. for a user). It is handled by the cooldown itself. * It contains the instance of an active cooldown (e.g. for a user). It is handled by the cooldown itself.
*/ */
@@ -42,7 +42,7 @@ export class ODCooldownData<Data extends object> extends ODManagerData {
} }
/**## ODCooldown `class` /**## ODCooldown `class`
* This is an open ticket cooldown. * This is an Open Ticket cooldown.
* *
* It doesn't do anything on it's own, but it provides the methods that are used to interact with a cooldown. * It doesn't do anything on it's own, but it provides the methods that are used to interact with a cooldown.
* This class can be extended from to create a working cooldown. * This class can be extended from to create a working cooldown.
@@ -77,7 +77,7 @@ export class ODCooldown<Data extends object> extends ODManagerData {
} }
/**## ODCounterCooldown `class` /**## ODCounterCooldown `class`
* This is an open ticket counter cooldown. * This is an Open Ticket counter cooldown.
* *
* It is is a cooldown based on a counter. When the number exceeds the limit, the cooldown is activated. * It is is a cooldown based on a counter. When the number exceeds the limit, the cooldown is activated.
* The number will automatically be decreased with a set amount & interval. * The number will automatically be decreased with a set amount & interval.
@@ -154,7 +154,7 @@ export class ODCounterCooldown extends ODCooldown<{value:number}> {
} }
/**## ODIncrementalCounterCooldown `class` /**## ODIncrementalCounterCooldown `class`
* This is an open ticket incremental counter cooldown. * This is an Open Ticket incremental counter cooldown.
* *
* It is is a cooldown based on an incremental counter. It is exactly the same as the normal counter, * It is is a cooldown based on an incremental counter. It is exactly the same as the normal counter,
* with the only difference being that it still increments when the limit is already exeeded. * with the only difference being that it still increments when the limit is already exeeded.
@@ -232,7 +232,7 @@ export class ODIncrementalCounterCooldown extends ODCooldown<{value:number}> {
} }
/**## ODTimeoutCooldown `class` /**## ODTimeoutCooldown `class`
* This is an open ticket timeout cooldown. * This is an Open Ticket timeout cooldown.
* *
* It is a cooldown based on a timer. When triggered/updated, the cooldown is activated for the set amount of time. * It is a cooldown based on a timer. When triggered/updated, the cooldown is activated for the set amount of time.
* After the timer has timed out, the cooldown will be deleted. * After the timer has timed out, the cooldown will be deleted.
@@ -288,7 +288,7 @@ export class ODTimeoutCooldown extends ODCooldown<{date:number}> {
} }
/**## ODIncrementalTimeoutCooldown `class` /**## ODIncrementalTimeoutCooldown `class`
* This is an open ticket incremental timeout cooldown. * This is an Open Ticket incremental timeout cooldown.
* *
* It is is a cooldown based on an incremental timer. It is exactly the same as the normal timer, * It is is a cooldown based on an incremental timer. It is exactly the same as the normal timer,
* with the only difference being that it adds additional time when triggered/updated while the cooldown is already active. * with the only difference being that it adds additional time when triggered/updated while the cooldown is already active.
+4 -4
View File
@@ -8,7 +8,7 @@ import { ODDebugger } from "./console"
import * as fjs from "formatted-json-stringify" import * as fjs from "formatted-json-stringify"
/**## ODDatabaseManager `class` /**## ODDatabaseManager `class`
* This is an open ticket database manager. * This is an Open Ticket database manager.
* *
* It manages all databases in the bot and allows to permanently store data from the bot! * It manages all databases in the bot and allows to permanently store data from the bot!
* *
@@ -32,7 +32,7 @@ export class ODDatabaseManager extends ODManager<ODDatabase> {
} }
/**## ODDatabase `class` /**## ODDatabase `class`
* This is an open ticket database template. * This is an Open Ticket database template.
* This class doesn't do anything at all, it just gives a template & basic methods for a database. Use `ODJsonDatabase` instead! * This class doesn't do anything at all, it just gives a template & basic methods for a database. Use `ODJsonDatabase` instead!
* *
* You can use this class if you want to create your own database implementation (e.g. `mongodb`, `mysql`,...)! * You can use this class if you want to create your own database implementation (e.g. `mongodb`, `mysql`,...)!
@@ -79,7 +79,7 @@ export class ODDatabase extends ODManagerData {
export type ODJsonDatabaseStructure = {category:string, key:string, value:ODValidJsonType}[] export type ODJsonDatabaseStructure = {category:string, key:string, value:ODValidJsonType}[]
/**## ODJsonDatabase `class` /**## ODJsonDatabase `class`
* This is an open ticket JSON database. * This is an Open Ticket JSON database.
* It stores data in a `json` file as a large `Array` using the `category`, `key`, `value` strategy. * It stores data in a `json` file as a large `Array` using the `category`, `key`, `value` strategy.
* You can store the following types: `string`, `number`, `boolean`, `array`, `object` & `null`! * You can store the following types: `string`, `number`, `boolean`, `array`, `object` & `null`!
* *
@@ -179,7 +179,7 @@ export class ODJsonDatabase extends ODDatabase {
/**## ODFormattedJsonDatabase `class` /**## ODFormattedJsonDatabase `class`
* This is an open ticket Formatted JSON database. * This is an Open Ticket Formatted JSON database.
* It stores data in a `json` file as a large `Array` using the `category`, `key`, `value` strategy. * It stores data in a `json` file as a large `Array` using the `category`, `key`, `value` strategy.
* You can store the following types: `string`, `number`, `boolean`, `array`, `object` & `null`! * You can store the following types: `string`, `number`, `boolean`, `array`, `object` & `null`!
* *
+62 -62
View File
@@ -20,31 +20,31 @@ export interface ODDefaults {
/**Don't crash the bot when a plugin crashes! */ /**Don't crash the bot when a plugin crashes! */
softPluginLoading:boolean, softPluginLoading:boolean,
/**Load the default open ticket plugin classes. */ /**Load the default Open Ticket plugin classes. */
pluginClassLoading:boolean, pluginClassLoading:boolean,
/**Load the default open ticket flags. */ /**Load the default Open Ticket flags. */
flagLoading:boolean, flagLoading:boolean,
/**Enable the default initializer for open ticket flags. */ /**Enable the default initializer for Open Ticket flags. */
flagInitiating:boolean, flagInitiating:boolean,
/**Load the default open ticket progress bar renderers. */ /**Load the default Open Ticket progress bar renderers. */
progressBarRendererLoading:boolean, progressBarRendererLoading:boolean,
/**Load the default open ticket progress bars. */ /**Load the default Open Ticket progress bars. */
progressBarLoading:boolean, progressBarLoading:boolean,
/**Load the default open ticket configs. */ /**Load the default Open Ticket configs. */
configLoading:boolean, configLoading:boolean,
/**Enable the default initializer for open ticket config. */ /**Enable the default initializer for Open Ticket config. */
configInitiating:boolean, configInitiating:boolean,
/**Load the default open ticket databases. */ /**Load the default Open Ticket databases. */
databaseLoading:boolean, databaseLoading:boolean,
/**Enable the default initializer for open ticket database. */ /**Enable the default initializer for Open Ticket database. */
databaseInitiating:boolean, databaseInitiating:boolean,
/**Load the default open ticket sessions. */ /**Load the default Open Ticket sessions. */
sessionLoading:boolean, sessionLoading:boolean,
/**Load the default open ticket languages. */ /**Load the default Open Ticket languages. */
languageLoading:boolean, languageLoading:boolean,
/**Enable the default initializer for open ticket languages. */ /**Enable the default initializer for Open Ticket languages. */
languageInitiating:boolean, languageInitiating:boolean,
/**Enable selecting the current language from `config/general.json`. */ /**Enable selecting the current language from `config/general.json`. */
languageSelection:boolean, languageSelection:boolean,
@@ -53,13 +53,13 @@ export interface ODDefaults {
/****[NOT FOR PLUGIN TRANSLATIONS]** The full list of available languages (used in the default config checker). */ /****[NOT FOR PLUGIN TRANSLATIONS]** The full list of available languages (used in the default config checker). */
languageList:string[], languageList:string[],
/**Load the default open ticket config checker. */ /**Load the default Open Ticket config checker. */
checkerLoading:boolean, checkerLoading:boolean,
/**Load the default open ticket config checker functions. */ /**Load the default Open Ticket config checker functions. */
checkerFunctionLoading:boolean, checkerFunctionLoading:boolean,
/**Enable the default execution of the config checkers. */ /**Enable the default execution of the config checkers. */
checkerExecution:boolean, checkerExecution:boolean,
/**Load the default open ticket config checker translations. */ /**Load the default Open Ticket config checker translations. */
checkerTranslationLoading:boolean, checkerTranslationLoading:boolean,
/**Enable the default rendering of the config checkers. */ /**Enable the default rendering of the config checkers. */
checkerRendering:boolean, checkerRendering:boolean,
@@ -68,111 +68,111 @@ export interface ODDefaults {
/**Render the checker even when there are no errors & warnings. */ /**Render the checker even when there are no errors & warnings. */
checkerRenderEmpty:boolean, checkerRenderEmpty:boolean,
/**Load the default open ticket client configuration. */ /**Load the default Open Ticket client configuration. */
clientLoading:boolean, clientLoading:boolean,
/**Load the default open ticket client initialization. */ /**Load the default Open Ticket client initialization. */
clientInitiating:boolean, clientInitiating:boolean,
/**Load the default open ticket client ready actions (status, commands, permissions, ...). */ /**Load the default Open Ticket client ready actions (status, commands, permissions, ...). */
clientReady:boolean, clientReady:boolean,
/**Create a warning when the bot is present in multiple guilds. */ /**Create a warning when the bot is present in multiple guilds. */
clientMultiGuildWarning:boolean, clientMultiGuildWarning:boolean,
/**Load the default open ticket client activity (from `config/general.json`). */ /**Load the default Open Ticket client activity (from `config/general.json`). */
clientActivityLoading:boolean, clientActivityLoading:boolean,
/**Load the default open ticket client activity initialization (& status refresh). */ /**Load the default Open Ticket client activity initialization (& status refresh). */
clientActivityInitiating:boolean, clientActivityInitiating:boolean,
/**Load the default open ticket slash commands. */ /**Load the default Open Ticket slash commands. */
slashCommandLoading:boolean, slashCommandLoading:boolean,
/**Load the default open ticket slash command registerer (register slash cmds in discord). */ /**Load the default Open Ticket slash command registerer (register slash cmds in discord). */
slashCommandRegistering:boolean, slashCommandRegistering:boolean,
/**When enabled, the bot is forced to re-register all slash commands in the server. This can be used in case of a auto-update malfunction. */ /**When enabled, the bot is forced to re-register all slash commands in the server. This can be used in case of a auto-update malfunction. */
forceSlashCommandRegistration:boolean, forceSlashCommandRegistration:boolean,
/**When enabled, the bot is allowed to unregister all slash commands which aren't used in Open Ticket. Disable this if you don't want to use the Open Ticket `ODSlashCommand` classes. */ /**When enabled, the bot is allowed to unregister all slash commands which aren't used in Open Ticket. Disable this if you don't want to use the Open Ticket `ODSlashCommand` classes. */
allowSlashCommandRemoval:boolean, allowSlashCommandRemoval:boolean,
/**Load the default open ticket text commands. */ /**Load the default Open Ticket text commands. */
textCommandLoading:boolean, textCommandLoading:boolean,
/**Load the default open ticket questions (from `config/questions.json`) */ /**Load the default Open Ticket questions (from `config/questions.json`) */
questionLoading:boolean, questionLoading:boolean,
/**Load the default open ticket options (from `config/options.json`) */ /**Load the default Open Ticket options (from `config/options.json`) */
optionLoading:boolean, optionLoading:boolean,
/**Load the default open ticket panels (from `config/panels.json`) */ /**Load the default Open Ticket panels (from `config/panels.json`) */
panelLoading:boolean, panelLoading:boolean,
/**Load the default open ticket tickets (from `database/tickets.json`) */ /**Load the default Open Ticket tickets (from `database/tickets.json`) */
ticketLoading:boolean, ticketLoading:boolean,
/**Load the default open ticket reaction roles (from `config/options.json`) */ /**Load the default Open Ticket reaction roles (from `config/options.json`) */
roleLoading:boolean, roleLoading:boolean,
/**Load the default open ticket blacklist (from `database/users.json`) */ /**Load the default Open Ticket blacklist (from `database/users.json`) */
blacklistLoading:boolean, blacklistLoading:boolean,
/**Load the default open ticket transcript compilers. */ /**Load the default Open Ticket transcript compilers. */
transcriptCompilerLoading:boolean, transcriptCompilerLoading:boolean,
/**Load the default open ticket transcript history (from `database/transcripts.json`) */ /**Load the default Open Ticket transcript history (from `database/transcripts.json`) */
transcriptHistoryLoading:boolean, transcriptHistoryLoading:boolean,
/**Load the default open ticket button builders. */ /**Load the default Open Ticket button builders. */
buttonBuildersLoading:boolean, buttonBuildersLoading:boolean,
/**Load the default open ticket dropdown builders. */ /**Load the default Open Ticket dropdown builders. */
dropdownBuildersLoading:boolean, dropdownBuildersLoading:boolean,
/**Load the default open ticket file builders. */ /**Load the default Open Ticket file builders. */
fileBuildersLoading:boolean, fileBuildersLoading:boolean,
/**Load the default open ticket embed builders. */ /**Load the default Open Ticket embed builders. */
embedBuildersLoading:boolean, embedBuildersLoading:boolean,
/**Load the default open ticket message builders. */ /**Load the default Open Ticket message builders. */
messageBuildersLoading:boolean, messageBuildersLoading:boolean,
/**Load the default open ticket modal builders. */ /**Load the default Open Ticket modal builders. */
modalBuildersLoading:boolean, modalBuildersLoading:boolean,
/**Load the default open ticket command responders. */ /**Load the default Open Ticket command responders. */
commandRespondersLoading:boolean, commandRespondersLoading:boolean,
/**Load the default open ticket button responders. */ /**Load the default Open Ticket button responders. */
buttonRespondersLoading:boolean, buttonRespondersLoading:boolean,
/**Load the default open ticket dropdown responders. */ /**Load the default Open Ticket dropdown responders. */
dropdownRespondersLoading:boolean, dropdownRespondersLoading:boolean,
/**Load the default open ticket modal responders. */ /**Load the default Open Ticket modal responders. */
modalRespondersLoading:boolean, modalRespondersLoading:boolean,
/**Set the time (in ms) before open ticket sends an error message when no reply is sent in a responder. */ /**Set the time (in ms) before Open Ticket sends an error message when no reply is sent in a responder. */
responderTimeoutMs:number, responderTimeoutMs:number,
/**Load the default open ticket actions. */ /**Load the default Open Ticket actions. */
actionsLoading:boolean, actionsLoading:boolean,
/**Load the default open ticket verify bars. */ /**Load the default Open Ticket verify bars. */
verifyBarsLoading:boolean, verifyBarsLoading:boolean,
/**Load the default open ticket permissions. */ /**Load the default Open Ticket permissions. */
permissionsLoading:boolean, permissionsLoading:boolean,
/**Load the default open ticket posts. */ /**Load the default Open Ticket posts. */
postsLoading:boolean, postsLoading:boolean,
/**Initiate the default open ticket posts. */ /**Initiate the default Open Ticket posts. */
postsInitiating:boolean, postsInitiating:boolean,
/**Load the default open ticket cooldowns. */ /**Load the default Open Ticket cooldowns. */
cooldownsLoading:boolean, cooldownsLoading:boolean,
/**Initiate the default open ticket cooldowns. */ /**Initiate the default Open Ticket cooldowns. */
cooldownsInitiating:boolean, cooldownsInitiating:boolean,
/**Load the default open ticket help menu categories. */ /**Load the default Open Ticket help menu categories. */
helpMenuCategoryLoading:boolean, helpMenuCategoryLoading:boolean,
/**Load the default open ticket help menu components. */ /**Load the default Open Ticket help menu components. */
helpMenuComponentLoading:boolean, helpMenuComponentLoading:boolean,
/**Load the default open ticket stat scopes. */ /**Load the default Open Ticket stat scopes. */
statScopesLoading:boolean, statScopesLoading:boolean,
/**Load the default open ticket stats. */ /**Load the default Open Ticket stats. */
statLoading:boolean, statLoading:boolean,
/**Initiate the default open ticket stats. */ /**Initiate the default Open Ticket stats. */
statInitiating:boolean, statInitiating:boolean,
/**Load the default open ticket code/functions. */ /**Load the default Open Ticket code/functions. */
codeLoading:boolean, codeLoading:boolean,
/**Execute the default open ticket code/functions. */ /**Execute the default Open Ticket code/functions. */
codeExecution:boolean, codeExecution:boolean,
/**Load the default open ticket livestatus. */ /**Load the default Open Ticket livestatus. */
liveStatusLoading:boolean, liveStatusLoading:boolean,
/**Load the default open ticket startscreen. */ /**Load the default Open Ticket startscreen. */
startScreenLoading:boolean, startScreenLoading:boolean,
/**Render the default open ticket startscreen. */ /**Render the default Open Ticket startscreen. */
startScreenRendering:boolean, startScreenRendering:boolean,
/**Load the emoji style from the open ticket general config. */ /**Load the emoji style from the Open Ticket general config. */
emojiTitleStyleLoading:boolean, emojiTitleStyleLoading:boolean,
/**The emoji style to use in embed & message titles using `utilities.emoijTitle()` */ /**The emoji style to use in embed & message titles using `utilities.emoijTitle()` */
emojiTitleStyle:"disabled"|"before"|"after"|"double", emojiTitleStyle:"disabled"|"before"|"after"|"double",
@@ -217,9 +217,9 @@ export type ODDefaultsStringArray = {
}[keyof ODDefaults] }[keyof ODDefaults]
/**## ODDefaultsManager `class` /**## ODDefaultsManager `class`
* This is an open ticket defaults manager. * This is an Open Ticket defaults manager.
* *
* It manages all settings in open ticket that are not meant to be in the config. * It manages all settings in Open Ticket that are not meant to be in the config.
* Here you can disable certain default features to replace them or to specifically enable them! * Here you can disable certain default features to replace them or to specifically enable them!
* *
* You are unable to add your own defaults, you can only edit Open Ticket defaults! * You are unable to add your own defaults, you can only edit Open Ticket defaults!
+4 -4
View File
@@ -5,13 +5,13 @@ import { ODManagerData, ODManager, ODValidId } from "./base"
import { ODConsoleWarningMessage, ODDebugger } from "./console" import { ODConsoleWarningMessage, ODDebugger } from "./console"
/**## ODEvent `class` /**## ODEvent `class`
* This is an open ticket event. * This is an Open Ticket event.
* *
* This class is made to work with the `ODEventManager` to handle events. * This class is made to work with the `ODEventManager` to handle events.
* The function of this specific class is to manage all listeners for a specifc event! * The function of this specific class is to manage all listeners for a specifc event!
*/ */
export class ODEvent extends ODManagerData { export class ODEvent extends ODManagerData {
/**Alias to open ticket debugger. */ /**Alias to Open Ticket debugger. */
#debug?: ODDebugger #debug?: ODDebugger
/**The list of permanent listeners. */ /**The list of permanent listeners. */
listeners: Function[] = [] listeners: Function[] = []
@@ -20,7 +20,7 @@ export class ODEvent extends ODManagerData {
/**The max listener limit before a possible memory leak will be announced */ /**The max listener limit before a possible memory leak will be announced */
listenerLimit: number = 25 listenerLimit: number = 25
/**Use the open ticket debugger in this manager for logs*/ /**Use the Open Ticket debugger in this manager for logs*/
useDebug(debug:ODDebugger|null){ useDebug(debug:ODDebugger|null){
this.#debug = debug ?? undefined this.#debug = debug ?? undefined
} }
@@ -71,7 +71,7 @@ export class ODEvent extends ODManagerData {
} }
/**## ODEventManager `class` /**## ODEventManager `class`
* This is an open ticket event manager. * This is an Open Ticket event manager.
* *
* This class is made to manage all events in the bot. You can compare it with the built-in node.js `EventEmitter` * This class is made to manage all events in the bot. You can compare it with the built-in node.js `EventEmitter`
* *
+2 -2
View File
@@ -5,7 +5,7 @@ import { ODId, ODValidId, ODManager, ODManagerData } from "./base"
import { ODDebugger } from "./console" import { ODDebugger } from "./console"
/**## ODFlag `class` /**## ODFlag `class`
* This is an open ticket flag. * This is an Open Ticket flag.
* *
* A flag is a boolean that can be specified by a parameter in the console. * A flag is a boolean that can be specified by a parameter in the console.
* It's useful for small settings that are only required once in a while. * It's useful for small settings that are only required once in a while.
@@ -54,7 +54,7 @@ export class ODFlag extends ODManagerData {
} }
/**## ODFlagManager `class` /**## ODFlagManager `class`
* This is an open ticket flag manager. * This is an Open Ticket flag manager.
* *
* This class is responsible for managing & initiating all flags of the bot. * This class is responsible for managing & initiating all flags of the bot.
* It also contains a shortcut for initiating all flags. * It also contains a shortcut for initiating all flags.
+6 -6
View File
@@ -10,7 +10,7 @@ import { ODDebugger } from "./console"
export type ODHelpMenuComponentRenderer = (page:number, category:number, location:number, mode:"slash"|"text") => string|Promise<string> export type ODHelpMenuComponentRenderer = (page:number, category:number, location:number, mode:"slash"|"text") => string|Promise<string>
/**## ODHelpMenuComponent `class` /**## ODHelpMenuComponent `class`
* This is an open ticket help menu component. * This is an Open Ticket help menu component.
* *
* It can render something on the Open Ticket help menu. * It can render something on the Open Ticket help menu.
*/ */
@@ -28,7 +28,7 @@ export class ODHelpMenuComponent extends ODManagerData {
} }
/**## ODHelpMenuTextComponent `class` /**## ODHelpMenuTextComponent `class`
* This is an open ticket help menu text component. * This is an Open Ticket help menu text component.
* *
* It can render a static piece of text on the Open Ticket help menu. * It can render a static piece of text on the Open Ticket help menu.
*/ */
@@ -69,7 +69,7 @@ export interface ODHelpMenuCommandComponentSettings {
} }
/**## ODHelpMenuCommandComponent `class` /**## ODHelpMenuCommandComponent `class`
* This is an open ticket help menu command component. * This is an Open Ticket help menu command component.
* *
* It contains a useful helper to render a command in the Open Ticket help menu. * It contains a useful helper to render a command in the Open Ticket help menu.
*/ */
@@ -93,7 +93,7 @@ export class ODHelpMenuCommandComponent extends ODHelpMenuComponent {
} }
/**## ODHelpMenuCategory `class` /**## ODHelpMenuCategory `class`
* This is an open ticket help menu category. * This is an Open Ticket help menu category.
* *
* Every category in the help menu is an embed field by default. * Every category in the help menu is an embed field by default.
* Try to limit the amount of components per category. * Try to limit the amount of components per category.
@@ -148,7 +148,7 @@ export class ODHelpMenuCategory extends ODManager<ODHelpMenuComponent> {
export type ODHelpMenuRenderResult = {name:string, value:string}[][] export type ODHelpMenuRenderResult = {name:string, value:string}[][]
/**## ODHelpMenuManager `class` /**## ODHelpMenuManager `class`
* This is an open ticket help menu manager. * This is an Open Ticket help menu manager.
* *
* It is responsible for rendering the entire help menu content. * It is responsible for rendering the entire help menu content.
* You are also able to configure the amount of categories per page here. * You are also able to configure the amount of categories per page here.
@@ -156,7 +156,7 @@ export type ODHelpMenuRenderResult = {name:string, value:string}[][]
* Fewer Categories == More Clean Menu * Fewer Categories == More Clean Menu
*/ */
export class ODHelpMenuManager extends ODManager<ODHelpMenuCategory> { export class ODHelpMenuManager extends ODManager<ODHelpMenuCategory> {
/**Alias to open ticket debugger. */ /**Alias to Open Ticket debugger. */
#debug: ODDebugger #debug: ODDebugger
/**The amount of categories per-page. */ /**The amount of categories per-page. */
categoriesPerPage: number = 3 categoriesPerPage: number = 3
+3 -3
View File
@@ -23,7 +23,7 @@ export interface ODLanguageMetadata {
} }
/**## ODLanguageManager `class` /**## ODLanguageManager `class`
* This is an open ticket language manager. * This is an Open Ticket language manager.
* *
* It manages all languages in the bot and manages translation for you! * It manages all languages in the bot and manages translation for you!
* Get a translation via the `getTranslation()` or `getTranslationWithParams()` methods. * Get a translation via the `getTranslation()` or `getTranslationWithParams()` methods.
@@ -144,7 +144,7 @@ export class ODLanguageManager extends ODManager<ODLanguage> {
} }
/**## ODLanguage `class` /**## ODLanguage `class`
* This is an open ticket language file. * This is an Open Ticket language file.
* *
* It contains metadata and all translation strings available in this language. * It contains metadata and all translation strings available in this language.
* Register this class to an `ODLanguageManager` to use it! * Register this class to an `ODLanguageManager` to use it!
@@ -173,7 +173,7 @@ export class ODLanguage extends ODManagerData {
} }
/**## ODJsonLanguage `class` /**## ODJsonLanguage `class`
* This is an open ticket JSON language file. * This is an Open Ticket JSON language file.
* *
* It contains metadata and all translation strings from a certain JSON file (in `./languages/`). * It contains metadata and all translation strings from a certain JSON file (in `./languages/`).
* Register this class to an `ODLanguageManager` to use it! * Register this class to an `ODLanguageManager` to use it!
+2 -2
View File
@@ -48,7 +48,7 @@ export enum ODPermissionLevel {
} }
/**## ODPermission `class` /**## ODPermission `class`
* This is an open ticket permission. * This is an Open Ticket permission.
* *
* It defines a single permission level for a specific scope (global/channel & user/role) * It defines a single permission level for a specific scope (global/channel & user/role)
* These permissions only apply to commands & interactions. * These permissions only apply to commands & interactions.
@@ -101,7 +101,7 @@ export interface ODPermissionSettings {
export type ODPermissionCalculationCallback = (user:discord.User, channel?:discord.Channel|null, guild?:discord.Guild|null, settings?:ODPermissionSettings|null) => Promise<ODPermissionResult> export type ODPermissionCalculationCallback = (user:discord.User, channel?:discord.Channel|null, guild?:discord.Guild|null, settings?:ODPermissionSettings|null) => Promise<ODPermissionResult>
/**## ODPermissionManager `class` /**## ODPermissionManager `class`
* This is an open ticket permission manager. * This is an Open Ticket permission manager.
* *
* It manages all permissions in the bot! * It manages all permissions in the bot!
* Use the `getPermissions()` and `hasPermissions()` methods to get user perms. * Use the `getPermissions()` and `hasPermissions()` methods to get user perms.
+3 -3
View File
@@ -16,7 +16,7 @@ export interface ODUnknownCrashedPlugin {
} }
/**## ODPluginManager `class` /**## ODPluginManager `class`
* This is an open ticket plugin manager. * This is an Open Ticket plugin manager.
* *
* It manages all active plugins in the bot! * It manages all active plugins in the bot!
* It also contains all "plugin classes" which are managers registered by plugins. * It also contains all "plugin classes" which are managers registered by plugins.
@@ -93,7 +93,7 @@ export interface ODPluginDetails {
} }
/**## ODPlugin `class` /**## ODPlugin `class`
* This is an open ticket plugin. * This is an Open Ticket plugin.
* *
* It represents a single plugin in the `./plugins/` directory. * It represents a single plugin in the `./plugins/` directory.
* All plugins are accessible via the `openticket.plugins` global. * All plugins are accessible via the `openticket.plugins` global.
@@ -218,7 +218,7 @@ export class ODPlugin extends ODManagerData {
} }
/**## ODPluginClassManager `class` /**## ODPluginClassManager `class`
* This is an open ticket plugin class manager. * This is an Open Ticket plugin class manager.
* *
* It manages all managers registered by plugins! * It manages all managers registered by plugins!
* Plugins are able to register their own managers, handlers, functions, classes, ... here. * Plugins are able to register their own managers, handlers, functions, classes, ... here.
+2 -2
View File
@@ -7,7 +7,7 @@ import { ODDebugger } from "./console"
import * as discord from "discord.js" import * as discord from "discord.js"
/**## ODPostManager `class` /**## ODPostManager `class`
* This is an open ticket post manager. * This is an Open Ticket post manager.
* *
* It manages `ODPosts`'s for you. * It manages `ODPosts`'s for you.
* *
@@ -36,7 +36,7 @@ export class ODPostManager extends ODManager<ODPost<discord.GuildBasedChannel>>
} }
/**## ODPost `class` /**## ODPost `class`
* This is an open ticket post class. * This is an Open Ticket post class.
* *
* A post is just a shortcut to a static discord channel or category. * A post is just a shortcut to a static discord channel or category.
* This can be used to get a specific channel over and over again! * This can be used to get a specific channel over and over again!
+6 -6
View File
@@ -6,7 +6,7 @@ import { ODDebugger } from "./console"
import readline from "readline" import readline from "readline"
/**## ODProgressBarRendererManager `class` /**## ODProgressBarRendererManager `class`
* This is an open ticket progress bar renderer manager. * This is an Open Ticket progress bar renderer manager.
* *
* It is responsible for managing all console progress bar renderers in Open Ticket. * It is responsible for managing all console progress bar renderers in Open Ticket.
* *
@@ -19,7 +19,7 @@ export class ODProgressBarRendererManager extends ODManager<ODProgressBarRendere
} }
/**## ODProgressBarManager `class` /**## ODProgressBarManager `class`
* This is an open ticket progress bar manager. * This is an Open Ticket progress bar manager.
* *
* It is responsible for managing all console progress bars in Open Ticket. An example of this is the slash command registration progress bar. * It is responsible for managing all console progress bars in Open Ticket. An example of this is the slash command registration progress bar.
* *
@@ -40,7 +40,7 @@ export class ODProgressBarManager extends ODManager<ODProgressBar> {
export type ODProgressBarRenderFunc<Settings extends {}> = (settings:Settings,min:number,max:number,value:number,prefix:string|null,suffix:string|null) => string export type ODProgressBarRenderFunc<Settings extends {}> = (settings:Settings,min:number,max:number,value:number,prefix:string|null,suffix:string|null) => string
/**## ODProgressBarRenderer `class` /**## ODProgressBarRenderer `class`
* This is an open ticket console progress bar renderer. * This is an Open Ticket console progress bar renderer.
* *
* It is used to render a progress bar in the console of the bot. * It is used to render a progress bar in the console of the bot.
* *
@@ -76,7 +76,7 @@ export class ODProgressBarRenderer<Settings extends {}> extends ODManagerData {
} }
/**## ODProgressBar `class` /**## ODProgressBar `class`
* This is an open ticket console progress bar. * This is an Open Ticket console progress bar.
* *
* It is used to create a simple or advanced progress bar in the console of the bot. * It is used to create a simple or advanced progress bar in the console of the bot.
* These progress bars are not visible in the `otdebug.txt` file and should only be used as extra visuals. * These progress bars are not visible in the `otdebug.txt` file and should only be used as extra visuals.
@@ -160,7 +160,7 @@ export class ODProgressBar extends ODManagerData {
} }
/**## ODTimedProgressBar `class` /**## ODTimedProgressBar `class`
* This is an open ticket timed console progress bar. * This is an Open Ticket timed console progress bar.
* *
* It is used to create a simple timed progress bar in the console. * It is used to create a simple timed progress bar in the console.
* You can set a fixed duration (milliseconds) in the constructor. * You can set a fixed duration (milliseconds) in the constructor.
@@ -204,7 +204,7 @@ export class ODTimedProgressBar extends ODProgressBar {
} }
/**## ODManualProgressBar `class` /**## ODManualProgressBar `class`
* This is an open ticket manual console progress bar. * This is an Open Ticket manual console progress bar.
* *
* It is used to create a simple manual progress bar in the console. * It is used to create a simple manual progress bar in the console.
* You can update the progress manually using `update()`. * You can update the progress manually using `update()`.
+17 -17
View File
@@ -9,7 +9,7 @@ import { ODClientManager, ODSlashCommand, ODTextCommand, ODTextCommandInteractio
import { ODDropdownData, ODMessageBuildResult, ODMessageBuildSentResult, ODModalBuildResult } from "./builder" import { ODDropdownData, ODMessageBuildResult, ODMessageBuildSentResult, ODModalBuildResult } from "./builder"
/**## ODResponderImplementation `class` /**## ODResponderImplementation `class`
* This is an open ticket responder implementation. * This is an Open Ticket responder implementation.
* *
* It is a basic implementation of the `ODWorkerManager` used by all `ODResponder` classes. * It is a basic implementation of the `ODWorkerManager` used by all `ODResponder` classes.
* *
@@ -39,7 +39,7 @@ export class ODResponderImplementation<Instance,Source extends string,Params> ex
export type ODResponderTimeoutErrorCallback<Instance, Source extends "slash"|"text"|"button"|"dropdown"|"modal"|"other"> = (instance:Instance, source:Source) => void|Promise<void> export type ODResponderTimeoutErrorCallback<Instance, Source extends "slash"|"text"|"button"|"dropdown"|"modal"|"other"> = (instance:Instance, source:Source) => void|Promise<void>
/**## ODResponderManager `class` /**## ODResponderManager `class`
* This is an open ticket responder manager. * This is an Open Ticket responder manager.
* *
* It contains all Open Ticket responders. Responders can respond to an interaction, button, dropdown, modal or command. * It contains all Open Ticket responders. Responders can respond to an interaction, button, dropdown, modal or command.
* *
@@ -71,7 +71,7 @@ export class ODResponderManager {
} }
/**## ODCommandResponderManager `class` /**## ODCommandResponderManager `class`
* This is an open ticket command responder manager. * This is an Open Ticket command responder manager.
* *
* It contains all Open Ticket command responders. These can respond to text & slash commands. * It contains all Open Ticket command responders. These can respond to text & slash commands.
* *
@@ -125,7 +125,7 @@ export class ODCommandResponderManager extends ODManager<ODCommandResponder<"sla
} }
/**## ODCommandResponderInstanceOptions `class` /**## ODCommandResponderInstanceOptions `class`
* This is an open ticket command responder instance options manager. * This is an Open Ticket command responder instance options manager.
* *
* This class will manage all options & subcommands from slash & text commands. * This class will manage all options & subcommands from slash & text commands.
*/ */
@@ -331,7 +331,7 @@ export class ODCommandResponderInstanceOptions {
/**## ODCommandResponderInstance `class` /**## ODCommandResponderInstance `class`
* This is an open ticket command responder instance. * This is an Open Ticket command responder instance.
* *
* An instance is an active slash interaction or used text command. You can reply to the command using `reply()` for both slash & text commands. * An instance is an active slash interaction or used text command. You can reply to the command using `reply()` for both slash & text commands.
*/ */
@@ -427,7 +427,7 @@ export class ODCommandResponderInstance {
} }
/**## ODCommandResponder `class` /**## ODCommandResponder `class`
* This is an open ticket command responder. * This is an Open Ticket command responder.
* *
* This class manages all workers which are executed when the related command is triggered. * This class manages all workers which are executed when the related command is triggered.
*/ */
@@ -448,7 +448,7 @@ export class ODCommandResponder<Source extends "slash"|"text",Params> extends OD
} }
/**## ODButtonResponderManager `class` /**## ODButtonResponderManager `class`
* This is an open ticket button responder manager. * This is an Open Ticket button responder manager.
* *
* It contains all Open Ticket button responders. These can respond to button interactions. * It contains all Open Ticket button responders. These can respond to button interactions.
* *
@@ -500,7 +500,7 @@ export class ODButtonResponderManager extends ODManager<ODButtonResponder<"butto
} }
/**## ODButtonResponderInstance `class` /**## ODButtonResponderInstance `class`
* This is an open ticket button responder instance. * This is an Open Ticket button responder instance.
* *
* An instance is an active button interaction. You can reply to the button using `reply()`. * An instance is an active button interaction. You can reply to the button using `reply()`.
*/ */
@@ -631,7 +631,7 @@ export class ODButtonResponderInstance {
} }
/**## ODButtonResponder `class` /**## ODButtonResponder `class`
* This is an open ticket button responder. * This is an Open Ticket button responder.
* *
* This class manages all workers which are executed when the related button is triggered. * This class manages all workers which are executed when the related button is triggered.
*/ */
@@ -644,7 +644,7 @@ export class ODButtonResponder<Source extends string,Params> extends ODResponder
} }
/**## ODDropdownResponderManager `class` /**## ODDropdownResponderManager `class`
* This is an open ticket dropdown responder manager. * This is an Open Ticket dropdown responder manager.
* *
* It contains all Open Ticket dropdown responders. These can respond to dropdown interactions. * It contains all Open Ticket dropdown responders. These can respond to dropdown interactions.
* *
@@ -696,7 +696,7 @@ export class ODDropdownResponderManager extends ODManager<ODDropdownResponder<"d
} }
/**## ODDropdownResponderInstanceValues `class` /**## ODDropdownResponderInstanceValues `class`
* This is an open ticket dropdown responder instance values manager. * This is an Open Ticket dropdown responder instance values manager.
* *
* This class will manage all values from the dropdowns & select menus. * This class will manage all values from the dropdowns & select menus.
*/ */
@@ -770,7 +770,7 @@ export class ODDropdownResponderInstanceValues {
} }
/**## ODDropdownResponderInstance `class` /**## ODDropdownResponderInstance `class`
* This is an open ticket dropdown responder instance. * This is an Open Ticket dropdown responder instance.
* *
* An instance is an active dropdown interaction. You can reply to the dropdown using `reply()`. * An instance is an active dropdown interaction. You can reply to the dropdown using `reply()`.
*/ */
@@ -918,7 +918,7 @@ export class ODDropdownResponderInstance {
} }
/**## ODDropdownResponder `class` /**## ODDropdownResponder `class`
* This is an open ticket dropdown responder. * This is an Open Ticket dropdown responder.
* *
* This class manages all workers which are executed when the related dropdown is triggered. * This class manages all workers which are executed when the related dropdown is triggered.
*/ */
@@ -931,7 +931,7 @@ export class ODDropdownResponder<Source extends string,Params> extends ODRespond
} }
/**## ODModalResponderManager `class` /**## ODModalResponderManager `class`
* This is an open ticket modal responder manager. * This is an Open Ticket modal responder manager.
* *
* It contains all Open Ticket modal responders. These can respond to modal interactions. * It contains all Open Ticket modal responders. These can respond to modal interactions.
* *
@@ -983,7 +983,7 @@ export class ODModalResponderManager extends ODManager<ODModalResponder<"modal",
} }
/**## ODModalResponderInstanceValues `class` /**## ODModalResponderInstanceValues `class`
* This is an open ticket modal responder instance values manager. * This is an Open Ticket modal responder instance values manager.
* *
* This class will manage all fields from the modals. * This class will manage all fields from the modals.
*/ */
@@ -1010,7 +1010,7 @@ export class ODModalResponderInstanceValues {
} }
/**## ODModalResponderInstance `class` /**## ODModalResponderInstance `class`
* This is an open ticket modal responder instance. * This is an Open Ticket modal responder instance.
* *
* An instance is an active modal interaction. You can reply to the modal using `reply()`. * An instance is an active modal interaction. You can reply to the modal using `reply()`.
*/ */
@@ -1101,7 +1101,7 @@ export class ODModalResponderInstance {
} }
/**## ODModalResponder `class` /**## ODModalResponder `class`
* This is an open ticket modal responder. * This is an Open Ticket modal responder.
* *
* This class manages all workers which are executed when the related modal is triggered. * This class manages all workers which are executed when the related modal is triggered.
*/ */
+3 -3
View File
@@ -6,9 +6,9 @@ import { ODDebugger } from "./console"
import * as crypto from "crypto" import * as crypto from "crypto"
/**## ODSessionManager `class` /**## ODSessionManager `class`
* This is an open ticket session manager. * This is an Open Ticket session manager.
* *
* It contains all sessions in open ticket. Sessions are a sort of temporary storage which will be cleared when the bot stops. * It contains all sessions in Open Ticket. Sessions are a sort of temporary storage which will be cleared when the bot stops.
* Data in sessions have a randomly generated key which will always be unique. * Data in sessions have a randomly generated key which will always be unique.
* *
* Visit the `ODSession` class for more info * Visit the `ODSession` class for more info
@@ -39,7 +39,7 @@ export interface ODSessionInstance {
export type ODSessionTimeoutCallback = (id:string, timeout:"default"|"custom", data:any, creation:Date) => void export type ODSessionTimeoutCallback = (id:string, timeout:"default"|"custom", data:any, creation:Date) => void
/**## ODSession `class` /**## ODSession `class`
* This is an open ticket session. * This is an Open Ticket session.
* *
* It can be used to create 100% unique id's for usage in the bot. An id can also store additional data which isn't saved to the filesystem. * It can be used to create 100% unique id's for usage in the bot. An id can also store additional data which isn't saved to the filesystem.
* You can almost compare it to the PHP session system. * You can almost compare it to the PHP session system.
+10 -10
View File
@@ -13,7 +13,7 @@ import ansis from "ansis"
export type ODStartScreenComponentRenderCallback = (location:number) => string|Promise<string> export type ODStartScreenComponentRenderCallback = (location:number) => string|Promise<string>
/**## ODStartScreenManager `class` /**## ODStartScreenManager `class`
* This is an open ticket startscreen manager. * This is an Open Ticket startscreen manager.
* *
* This class is responsible for managing & rendering the startscreen of the bot. * This class is responsible for managing & rendering the startscreen of the bot.
* The startscreen is the part you see when the bot has started up successfully. (e.g. the Open Ticket logo, logs, livestatus, flags, ...) * The startscreen is the part you see when the bot has started up successfully. (e.g. the Open Ticket logo, logs, livestatus, flags, ...)
@@ -57,7 +57,7 @@ export class ODStartScreenManager extends ODManager<ODStartScreenComponent> {
} }
/**## ODStartScreenComponent `class` /**## ODStartScreenComponent `class`
* This is an open ticket startscreen component. * This is an Open Ticket startscreen component.
* *
* This component can be rendered to the start screen of the bot. * This component can be rendered to the start screen of the bot.
* An optional priority can be specified to choose the location of the component. * An optional priority can be specified to choose the location of the component.
@@ -100,7 +100,7 @@ export interface ODStartScreenProperty {
} }
/**## ODStartScreenLogoComponent `class` /**## ODStartScreenLogoComponent `class`
* This is an open ticket startscreen logo component. * This is an Open Ticket startscreen logo component.
* *
* This component will render an ASCII art logo (from an array) to the startscreen. Every property in the array is another row. * This component will render an ASCII art logo (from an array) to the startscreen. Every property in the array is another row.
* An optional priority can be specified to choose the location of the component. * An optional priority can be specified to choose the location of the component.
@@ -140,7 +140,7 @@ export interface ODStartScreenHeaderAlignmentSettings {
} }
/**## ODStartScreenHeaderComponent `class` /**## ODStartScreenHeaderComponent `class`
* This is an open ticket startscreen header component. * This is an Open Ticket startscreen header component.
* *
* This component will render a header to the startscreen. Properties can be aligned left, right or centered. * This component will render a header to the startscreen. Properties can be aligned left, right or centered.
* An optional priority can be specified to choose the location of the component. * An optional priority can be specified to choose the location of the component.
@@ -192,7 +192,7 @@ export class ODStartScreenHeaderComponent extends ODStartScreenComponent {
} }
/**## ODStartScreenCategoryComponent `class` /**## ODStartScreenCategoryComponent `class`
* This is an open ticket startscreen category component. * This is an Open Ticket startscreen category component.
* *
* This component will render a category to the startscreen. This will only render the category name. You'll need to provide your own renderer for the contents. * This component will render a category to the startscreen. This will only render the category name. You'll need to provide your own renderer for the contents.
* An optional priority can be specified to choose the location of the component. * An optional priority can be specified to choose the location of the component.
@@ -216,7 +216,7 @@ export class ODStartScreenCategoryComponent extends ODStartScreenComponent {
} }
/**## ODStartScreenPropertiesCategoryComponent `class` /**## ODStartScreenPropertiesCategoryComponent `class`
* This is an open ticket startscreen properties category component. * This is an Open Ticket startscreen properties category component.
* *
* This component will render a properties category to the startscreen. This will list the properties in the category. * This component will render a properties category to the startscreen. This will list the properties in the category.
* An optional priority can be specified to choose the location of the component. * An optional priority can be specified to choose the location of the component.
@@ -238,7 +238,7 @@ export class ODStartScreenPropertiesCategoryComponent extends ODStartScreenCateg
} }
/**## ODStartScreenFlagsCategoryComponent `class` /**## ODStartScreenFlagsCategoryComponent `class`
* This is an open ticket startscreen flags category component. * This is an Open Ticket startscreen flags category component.
* *
* This component will render a flags category to the startscreen. This will list the enabled flags in the category. * This component will render a flags category to the startscreen. This will list the enabled flags in the category.
* An optional priority can be specified to choose the location of the component. * An optional priority can be specified to choose the location of the component.
@@ -256,7 +256,7 @@ export class ODStartScreenFlagsCategoryComponent extends ODStartScreenCategoryCo
} }
/**## ODStartScreenPluginsCategoryComponent `class` /**## ODStartScreenPluginsCategoryComponent `class`
* This is an open ticket startscreen plugins category component. * This is an Open Ticket startscreen plugins category component.
* *
* This component will render a plugins category to the startscreen. This will list the enabled, disabled & crashed plugins in the category. * This component will render a plugins category to the startscreen. This will list the enabled, disabled & crashed plugins in the category.
* An optional priority can be specified to choose the location of the component. * An optional priority can be specified to choose the location of the component.
@@ -283,7 +283,7 @@ export class ODStartScreenPluginsCategoryComponent extends ODStartScreenCategory
} }
/**## ODStartScreenLiveStatusCategoryComponent `class` /**## ODStartScreenLiveStatusCategoryComponent `class`
* This is an open ticket startscreen livestatus category component. * This is an Open Ticket startscreen livestatus category component.
* *
* This component will render a livestatus category to the startscreen. This will list the livestatus messages in the category. * This component will render a livestatus category to the startscreen. This will list the livestatus messages in the category.
* An optional priority can be specified to choose the location of the component. * An optional priority can be specified to choose the location of the component.
@@ -302,7 +302,7 @@ export class ODStartScreenLiveStatusCategoryComponent extends ODStartScreenCateg
} }
/**## ODStartScreenLogsCategoryComponent `class` /**## ODStartScreenLogsCategoryComponent `class`
* This is an open ticket startscreen logs category component. * This is an Open Ticket startscreen logs category component.
* *
* This component will render a logs category to the startscreen. This will only render the logs category name. * This component will render a logs category to the startscreen. This will only render the logs category name.
* An optional priority can be specified to choose the location of the component. * An optional priority can be specified to choose the location of the component.
+9 -9
View File
@@ -24,7 +24,7 @@ export type ODStatsManagerInitCallback = (database:ODJsonDatabaseStructure, dele
export type ODStatScopeSetMode = "set"|"increase"|"decrease" export type ODStatScopeSetMode = "set"|"increase"|"decrease"
/**## ODStatsManager `class` /**## ODStatsManager `class`
* This is an open ticket stats manager. * This is an Open Ticket stats manager.
* *
* This class is responsible for managing all stats of the bot. * This class is responsible for managing all stats of the bot.
* Stats are categorized in "scopes" which can be accessed in this manager. * Stats are categorized in "scopes" which can be accessed in this manager.
@@ -32,9 +32,9 @@ export type ODStatScopeSetMode = "set"|"increase"|"decrease"
* Stats can be accessed in the individual scopes. * Stats can be accessed in the individual scopes.
*/ */
export class ODStatsManager extends ODManager<ODStatScope> { export class ODStatsManager extends ODManager<ODStatScope> {
/**Alias to open ticket debugger. */ /**Alias to Open Ticket debugger. */
#debug: ODDebugger #debug: ODDebugger
/**Alias to open ticket stats database. */ /**Alias to Open Ticket stats database. */
database: ODDatabase|null = null database: ODDatabase|null = null
/**All the listeners for the init event. */ /**All the listeners for the init event. */
#initListeners: ODStatsManagerInitCallback[] = [] #initListeners: ODStatsManagerInitCallback[] = []
@@ -97,7 +97,7 @@ export class ODStatsManager extends ODManager<ODStatScope> {
} }
/**## ODStatScope `class` /**## ODStatScope `class`
* This is an open ticket stat scope. * This is an Open Ticket stat scope.
* *
* A scope can contain multiple stats. Every scope is seperated from other scopes. * A scope can contain multiple stats. Every scope is seperated from other scopes.
* Here, you can read & write the values of all stats. * Here, you can read & write the values of all stats.
@@ -109,7 +109,7 @@ export class ODStatScope extends ODManager<ODStat> {
id: ODId id: ODId
/**Is this stat scope already initialized? */ /**Is this stat scope already initialized? */
ready: boolean = false ready: boolean = false
/**Alias to open ticket stats database. */ /**Alias to Open Ticket stats database. */
database: ODDatabase|null = null database: ODDatabase|null = null
/**The name of this scope (used in embed title) */ /**The name of this scope (used in embed title) */
name:string name:string
@@ -202,7 +202,7 @@ export class ODStatScope extends ODManager<ODStat> {
} }
/**## ODStatGlobalScope `class` /**## ODStatGlobalScope `class`
* This is an open ticket stat global scope. * This is an Open Ticket stat global scope.
* *
* A scope can contain multiple stats. Every scope is seperated from other scopes. * A scope can contain multiple stats. Every scope is seperated from other scopes.
* Here, you can read & write the values of all stats. * Here, you can read & write the values of all stats.
@@ -230,7 +230,7 @@ export class ODStatGlobalScope extends ODStatScope {
export type ODStatRenderer = (value:ODValidStatValue, scopeId:string, guild:discord.Guild, channel:discord.TextBasedChannel, user:discord.User) => string|Promise<string> export type ODStatRenderer = (value:ODValidStatValue, scopeId:string, guild:discord.Guild, channel:discord.TextBasedChannel, user:discord.User) => string|Promise<string>
/**## ODStat `class` /**## ODStat `class`
* This is an open ticket statistic. * This is an Open Ticket statistic.
* *
* This single statistic doesn't do anything except defining the rules of this statistic. * This single statistic doesn't do anything except defining the rules of this statistic.
* Use it in a stats scope to register a new statistic. A statistic can also include a priority to choose the render priority. * Use it in a stats scope to register a new statistic. A statistic can also include a priority to choose the render priority.
@@ -254,7 +254,7 @@ export class ODStat extends ODManagerData {
} }
/**## ODBasicStat `class` /**## ODBasicStat `class`
* This is an open ticket basic statistic. * This is an Open Ticket basic statistic.
* *
* This single statistic will store a number, boolean or string in the database. * This single statistic will store a number, boolean or string in the database.
* Use it to create a simple statistic for any stats scope. * Use it to create a simple statistic for any stats scope.
@@ -277,7 +277,7 @@ export class ODBasicStat extends ODStat {
export type ODDynamicStatRenderer = (scopeId:string, guild:discord.Guild, channel:discord.TextBasedChannel, user:discord.User) => string|Promise<string> export type ODDynamicStatRenderer = (scopeId:string, guild:discord.Guild, channel:discord.TextBasedChannel, user:discord.User) => string|Promise<string>
/**## ODDynamicStat `class` /**## ODDynamicStat `class`
* This is an open ticket dynamic statistic. * This is an Open Ticket dynamic statistic.
* *
* A dynamic statistic does not store anything in the database! Instead, it will execute a function to return a custom result. * A dynamic statistic does not store anything in the database! Instead, it will execute a function to return a custom result.
* This can be used to show statistics which are not stored in the database. * This can be used to show statistics which are not stored in the database.
+2 -2
View File
@@ -9,7 +9,7 @@ import * as discord from "discord.js"
import { ODWorkerManager } from "./worker" import { ODWorkerManager } from "./worker"
/**## ODVerifyBar `class` /**## ODVerifyBar `class`
* This is an open ticket verifybar. * This is an Open Ticket verifybar.
* *
* It is contains 2 sets of workers and a lot of utilities for the (✅ ❌) verifybars in the bot. * It is contains 2 sets of workers and a lot of utilities for the (✅ ❌) verifybars in the bot.
* *
@@ -47,7 +47,7 @@ export class ODVerifyBar extends ODManagerData {
} }
/**## ODVerifyBarManager `class` /**## ODVerifyBarManager `class`
* This is an open ticket verifybar manager. * This is an Open Ticket verifybar manager.
* *
* It contains all (✅ ❌) verifybars in the bot. * It contains all (✅ ❌) verifybars in the bot.
* The `ODVerifyBar` classes contain `ODWorkerManager`'s that will be fired when the continue/stop buttons are pressed. * The `ODVerifyBar` classes contain `ODWorkerManager`'s that will be fired when the continue/stop buttons are pressed.
+2 -2
View File
@@ -9,7 +9,7 @@ import { ODId, ODManager, ODManagerData, ODValidId } from "./base"
export type ODWorkerCallback<Instance, Source extends string, Params> = (instance:Instance, params:Params, source:Source, cancel:() => void) => void|Promise<void> export type ODWorkerCallback<Instance, Source extends string, Params> = (instance:Instance, params:Params, source:Source, cancel:() => void) => void|Promise<void>
/**## ODWorker `class` /**## ODWorker `class`
* This is an open ticket worker. * This is an Open Ticket worker.
* *
* You can compare it with a normal javascript callback, but slightly more advanced! * You can compare it with a normal javascript callback, but slightly more advanced!
* *
@@ -32,7 +32,7 @@ export class ODWorker<Instance, Source extends string, Params> extends ODManager
} }
/**## ODWorker `class` /**## ODWorker `class`
* This is an open ticket worker manager. * This is an Open Ticket worker manager.
* *
* It manages & executes `ODWorker`'s in the correct order. * It manages & executes `ODWorker`'s in the correct order.
* *
+2 -2
View File
@@ -5,7 +5,7 @@ import { ODManager, ODManagerData, ODValidId } from "../modules/base"
import { ODDebugger } from "../modules/console" import { ODDebugger } from "../modules/console"
/**## ODBlacklist `class` /**## ODBlacklist `class`
* This is an open ticket blacklisted user. * This is an Open Ticket blacklisted user.
* *
* This class contains the id of the user this class belongs to & an optional reason for being blacklisted. * This class contains the id of the user this class belongs to & an optional reason for being blacklisted.
* *
@@ -31,7 +31,7 @@ export class ODBlacklist extends ODManagerData {
} }
/**## ODBlacklistManager `class` /**## ODBlacklistManager `class`
* This is an open ticket blacklist manager. * This is an Open Ticket blacklist manager.
* *
* This class manages all blacklisted users & their reason. Check if someone is blacklisted using their ID in the `exists()` method. * This class manages all blacklisted users & their reason. Check if someone is blacklisted using their ID in the `exists()` method.
* *
+14 -14
View File
@@ -10,7 +10,7 @@ import * as crypto from "crypto"
import { ODRoleUpdateMode } from "./role" import { ODRoleUpdateMode } from "./role"
/**## ODOptionManager `class` /**## ODOptionManager `class`
* This is an open ticket option manager. * This is an Open Ticket option manager.
* *
* This class manages all registered options in the bot. This also includes temporary options generated from tickets where the original option got deleted. * This class manages all registered options in the bot. This also includes temporary options generated from tickets where the original option got deleted.
* *
@@ -59,7 +59,7 @@ export interface ODOptionJson {
} }
/**## ODOption `class` /**## ODOption `class`
* This is an open ticket option. * This is an Open Ticket option.
* *
* This class contains all data related to this option (parsed from the config). * This class contains all data related to this option (parsed from the config).
* *
@@ -104,7 +104,7 @@ export class ODOption extends ODManager<ODOptionData<ODValidJsonType>> {
} }
/**## ODOptionData `class` /**## ODOptionData `class`
* This is open ticket option data. * This is Open Ticket option data.
* *
* This class contains a single property for an option. (string, number, boolean, object, array, null) * This class contains a single property for an option. (string, number, boolean, object, array, null)
* *
@@ -186,7 +186,7 @@ export interface ODTicketOptionIds {
} }
/**## ODTicketOption `class` /**## ODTicketOption `class`
* This is an open ticket ticket option. * This is an Open Ticket ticket option.
* *
* This class contains all data related to an Open Ticket ticket option (parsed from the config). * This class contains all data related to an Open Ticket ticket option (parsed from the config).
* *
@@ -240,7 +240,7 @@ export interface ODWebsiteOptionIds {
} }
/**## ODWebsiteOption `class` /**## ODWebsiteOption `class`
* This is an open ticket website option. * This is an Open Ticket website option.
* *
* This class contains all data related to an Open Ticket website option (parsed from the config). * This class contains all data related to an Open Ticket website option (parsed from the config).
* *
@@ -298,7 +298,7 @@ export interface ODRoleOptionIds {
} }
/**## ODRoleOption `class` /**## ODRoleOption `class`
* This is an open ticket role option. * This is an Open Ticket role option.
* *
* This class contains all data related to an Open Ticket role option (parsed from the config). * This class contains all data related to an Open Ticket role option (parsed from the config).
* *
@@ -338,7 +338,7 @@ export class ODRoleOption extends ODOption {
} }
/**## ODOptionSuffixManager `class` /**## ODOptionSuffixManager `class`
* This is an open ticket option suffix manager. * This is an Open Ticket option suffix manager.
* *
* This class manages all suffixes from option in the bot. The id of an option suffix is the same as the option id. * This class manages all suffixes from option in the bot. The id of an option suffix is the same as the option id.
* *
@@ -358,7 +358,7 @@ export class ODOptionSuffixManager extends ODManager<ODOptionSuffix> {
} }
/**## ODOptionSuffix `class` /**## ODOptionSuffix `class`
* This is an open ticket option suffix. * This is an Open Ticket option suffix.
* *
* This class can generate a suffix for a discord channel name from a specific option. * This class can generate a suffix for a discord channel name from a specific option.
* *
@@ -380,7 +380,7 @@ export class ODOptionSuffix extends ODManagerData {
} }
/**## ODOptionUserNameSuffix `class` /**## ODOptionUserNameSuffix `class`
* This is an open ticket user-name option suffix. * This is an Open Ticket user-name option suffix.
* *
* This class can generate a user-name suffix for a discord channel name from a specific option. * This class can generate a user-name suffix for a discord channel name from a specific option.
* *
@@ -393,7 +393,7 @@ export class ODOptionUserNameSuffix extends ODOptionSuffix {
} }
/**## ODOptionUserIdSuffix `class` /**## ODOptionUserIdSuffix `class`
* This is an open ticket user-id option suffix. * This is an Open Ticket user-id option suffix.
* *
* This class can generate a user-id suffix for a discord channel name from a specific option. * This class can generate a user-id suffix for a discord channel name from a specific option.
* *
@@ -406,7 +406,7 @@ export class ODOptionUserIdSuffix extends ODOptionSuffix {
} }
/**## ODOptionCounterDynamicSuffix `class` /**## ODOptionCounterDynamicSuffix `class`
* This is an open ticket counter-dynamic option suffix. * This is an Open Ticket counter-dynamic option suffix.
* *
* This class can generate a counter-dynamic suffix for a discord channel name from a specific option. * This class can generate a counter-dynamic suffix for a discord channel name from a specific option.
* *
@@ -436,7 +436,7 @@ export class ODOptionCounterDynamicSuffix extends ODOptionSuffix {
} }
/**## ODOptionCounterFixedSuffix `class` /**## ODOptionCounterFixedSuffix `class`
* This is an open ticket counter-fixed option suffix. * This is an Open Ticket counter-fixed option suffix.
* *
* This class can generate a counter-fixed suffix for a discord channel name from a specific option. * This class can generate a counter-fixed suffix for a discord channel name from a specific option.
* *
@@ -470,7 +470,7 @@ export class ODOptionCounterFixedSuffix extends ODOptionSuffix {
} }
/**## ODOptionRandomNumberSuffix `class` /**## ODOptionRandomNumberSuffix `class`
* This is an open ticket random-number option suffix. * This is an Open Ticket random-number option suffix.
* *
* This class can generate a random-number suffix for a discord channel name from a specific option. * This class can generate a random-number suffix for a discord channel name from a specific option.
* *
@@ -513,7 +513,7 @@ export class ODOptionRandomNumberSuffix extends ODOptionSuffix {
} }
/**## ODOptionRandomHexSuffix `class` /**## ODOptionRandomHexSuffix `class`
* This is an open ticket random-hex option suffix. * This is an Open Ticket random-hex option suffix.
* *
* This class can generate a random-hex suffix for a discord channel name from a specific option. * This class can generate a random-hex suffix for a discord channel name from a specific option.
* *
+3 -3
View File
@@ -6,7 +6,7 @@ import { ODId, ODManager, ODValidJsonType, ODValidId, ODVersion, ODValidButtonCo
import { ODDebugger } from "../modules/console" import { ODDebugger } from "../modules/console"
/**## ODPanelManager `class` /**## ODPanelManager `class`
* This is an open ticket panel manager. * This is an Open Ticket panel manager.
* *
* This class manages all registered panels in the bot. Only panels which are available in this manager can be auto-updated. * This class manages all registered panels in the bot. Only panels which are available in this manager can be auto-updated.
* *
@@ -74,7 +74,7 @@ export interface ODPanelIds {
} }
/**## ODPanel `class` /**## ODPanel `class`
* This is an open ticket panel. * This is an Open Ticket panel.
* *
* This class contains all data related to this panel (parsed from the config). * This class contains all data related to this panel (parsed from the config).
*/ */
@@ -134,7 +134,7 @@ export class ODPanel extends ODManager<ODPanelData<ODValidJsonType>> {
} }
/**## ODPanelData `class` /**## ODPanelData `class`
* This is open ticket panel data. * This is Open Ticket panel data.
* *
* This class contains a single property for a panel. (string, number, boolean, object, array, null) * This class contains a single property for a panel. (string, number, boolean, object, array, null)
* *
+5 -5
View File
@@ -5,7 +5,7 @@ import { ODId, ODManager, ODValidJsonType, ODValidId, ODVersion, ODManagerData }
import { ODDebugger } from "../modules/console" import { ODDebugger } from "../modules/console"
/**## ODQuestionManager `class` /**## ODQuestionManager `class`
* This is an open ticket question manager. * This is an Open Ticket question manager.
* *
* This class manages all registered questions in the bot. Only questions which are available in this manager can be used in options. * This class manages all registered questions in the bot. Only questions which are available in this manager can be used in options.
* *
@@ -51,7 +51,7 @@ export interface ODQuestionJson {
} }
/**## ODQuestion `class` /**## ODQuestion `class`
* This is an open ticket question. * This is an Open Ticket question.
* *
* This class contains all data related to this question (parsed from the config). * This class contains all data related to this question (parsed from the config).
* *
@@ -96,7 +96,7 @@ export class ODQuestion extends ODManager<ODQuestionData<ODValidJsonType>> {
} }
/**## ODQuestionData `class` /**## ODQuestionData `class`
* This is open ticket question data. * This is Open Ticket question data.
* *
* This class contains a single property for a question. (string, number, boolean, object, array, null) * This class contains a single property for a question. (string, number, boolean, object, array, null)
* *
@@ -140,7 +140,7 @@ export interface ODShortQuestionIds {
} }
/**## ODShortQuestion `class` /**## ODShortQuestion `class`
* This is an open ticket short question. * This is an Open Ticket short question.
* *
* This class contains all data related to an Open Ticket short question (parsed from the config). * This class contains all data related to an Open Ticket short question (parsed from the config).
* *
@@ -194,7 +194,7 @@ export interface ODParagraphQuestionIds {
} }
/**## ODParagraphQuestion `class` /**## ODParagraphQuestion `class`
* This is an open ticket paragraph question. * This is an Open Ticket paragraph question.
* *
* This class contains all data related to an Open Ticket paragraph question (parsed from the config). * This class contains all data related to an Open Ticket paragraph question (parsed from the config).
* *
+3 -3
View File
@@ -6,7 +6,7 @@ import { ODDebugger } from "../modules/console"
import * as discord from "discord.js" import * as discord from "discord.js"
/**## ODRoleManager `class` /**## ODRoleManager `class`
* This is an open ticket role manager. * This is an Open Ticket role manager.
* *
* This class manages all registered reaction roles in the bot. * This class manages all registered reaction roles in the bot.
* *
@@ -61,7 +61,7 @@ export interface ODRoleIds {
} }
/**## ODRole `class` /**## ODRole `class`
* This is an open ticket role. * This is an Open Ticket role.
* *
* This class contains all data related to this role (parsed from the config). * This class contains all data related to this role (parsed from the config).
* *
@@ -123,7 +123,7 @@ export class ODRole extends ODManager<ODRoleData<ODValidJsonType>> {
} }
/**## ODRoleData `class` /**## ODRoleData `class`
* This is open ticket role data. * This is Open Ticket role data.
* *
* This class contains a single property for a role. (string, number, boolean, object, array, null) * This class contains a single property for a role. (string, number, boolean, object, array, null)
* *
+2 -2
View File
@@ -8,7 +8,7 @@ import { ODTicketOption } from "./option"
import * as discord from "discord.js" import * as discord from "discord.js"
/**## ODTicketManager `class` /**## ODTicketManager `class`
* This is an open ticket ticket manager. * This is an Open Ticket ticket manager.
* *
* This class manages all currently created tickets in the bot. * This class manages all currently created tickets in the bot.
* *
@@ -261,7 +261,7 @@ export class ODTicket extends ODManager<ODTicketData<ODValidJsonType>> {
} }
/**## ODTicketData `class` /**## ODTicketData `class`
* This is open ticket ticket data. * This is Open Ticket ticket data.
* *
* This class contains a single property for a ticket. (string, number, boolean, object, array, null) * This class contains a single property for a ticket. (string, number, boolean, object, array, null)
* *