@open-discord-bots/framework 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +713 -0
- package/README.md +104 -0
- package/dist/api/api.d.ts +26 -0
- package/dist/api/api.js +44 -0
- package/dist/api/main.d.ts +133 -0
- package/dist/api/main.js +87 -0
- package/dist/api/modules/action.d.ts +34 -0
- package/dist/api/modules/action.js +58 -0
- package/dist/api/modules/base.d.ts +329 -0
- package/dist/api/modules/base.js +804 -0
- package/dist/api/modules/builder.d.ts +647 -0
- package/dist/api/modules/builder.js +1441 -0
- package/dist/api/modules/checker.d.ts +648 -0
- package/dist/api/modules/checker.js +1324 -0
- package/dist/api/modules/client.d.ts +768 -0
- package/dist/api/modules/client.js +1859 -0
- package/dist/api/modules/code.d.ts +33 -0
- package/dist/api/modules/code.js +57 -0
- package/dist/api/modules/config.d.ts +70 -0
- package/dist/api/modules/config.js +206 -0
- package/dist/api/modules/console.d.ts +305 -0
- package/dist/api/modules/console.js +598 -0
- package/dist/api/modules/cooldown.d.ts +138 -0
- package/dist/api/modules/cooldown.js +359 -0
- package/dist/api/modules/database.d.ts +135 -0
- package/dist/api/modules/database.js +271 -0
- package/dist/api/modules/event.d.ts +43 -0
- package/dist/api/modules/event.js +100 -0
- package/dist/api/modules/flag.d.ts +40 -0
- package/dist/api/modules/flag.js +72 -0
- package/dist/api/modules/fuse.d.ts +218 -0
- package/dist/api/modules/fuse.js +123 -0
- package/dist/api/modules/helpmenu.d.ts +106 -0
- package/dist/api/modules/helpmenu.js +167 -0
- package/dist/api/modules/language.d.ts +85 -0
- package/dist/api/modules/language.js +195 -0
- package/dist/api/modules/permission.d.ts +121 -0
- package/dist/api/modules/permission.js +314 -0
- package/dist/api/modules/plugin.d.ts +128 -0
- package/dist/api/modules/plugin.js +168 -0
- package/dist/api/modules/post.d.ts +44 -0
- package/dist/api/modules/post.js +92 -0
- package/dist/api/modules/progressbar.d.ts +108 -0
- package/dist/api/modules/progressbar.js +233 -0
- package/dist/api/modules/responder.d.ts +506 -0
- package/dist/api/modules/responder.js +1468 -0
- package/dist/api/modules/session.d.ts +58 -0
- package/dist/api/modules/session.js +171 -0
- package/dist/api/modules/startscreen.d.ts +165 -0
- package/dist/api/modules/startscreen.js +293 -0
- package/dist/api/modules/stat.d.ts +142 -0
- package/dist/api/modules/stat.js +293 -0
- package/dist/api/modules/verifybar.d.ts +54 -0
- package/dist/api/modules/verifybar.js +60 -0
- package/dist/api/modules/worker.d.ts +41 -0
- package/dist/api/modules/worker.js +93 -0
- package/dist/api/utils.d.ts +61 -0
- package/dist/api/utils.js +254 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +40 -0
- package/dist/startup/dump.d.ts +14 -0
- package/dist/startup/dump.js +79 -0
- package/dist/startup/errorHandling.d.ts +2 -0
- package/dist/startup/errorHandling.js +43 -0
- package/dist/startup/pluginLauncher.d.ts +2 -0
- package/dist/startup/pluginLauncher.js +202 -0
- package/package.json +9 -3
- package/src/api/api.ts +29 -0
- package/src/api/main.ts +189 -0
- package/src/api/modules/action.ts +58 -0
- package/src/api/modules/base.ts +811 -0
- package/src/api/modules/builder.ts +1554 -0
- package/src/api/modules/checker.ts +1549 -0
- package/src/api/modules/client.ts +2247 -0
- package/src/api/modules/code.ts +58 -0
- package/src/api/modules/config.ts +159 -0
- package/src/api/modules/console.ts +665 -0
- package/src/api/modules/cooldown.ts +348 -0
- package/src/api/modules/database.ts +278 -0
- package/src/api/modules/event.ts +99 -0
- package/src/api/modules/flag.ts +73 -0
- package/src/api/modules/fuse.ts +348 -0
- package/src/api/modules/helpmenu.ts +216 -0
- package/src/api/modules/language.ts +201 -0
- package/src/api/modules/permission.ts +340 -0
- package/src/api/modules/plugin.ts +242 -0
- package/src/api/modules/post.ts +90 -0
- package/src/api/modules/progressbar.ts +232 -0
- package/src/api/modules/responder.ts +1420 -0
- package/src/api/modules/session.ts +155 -0
- package/src/api/modules/startscreen.ts +320 -0
- package/src/api/modules/stat.ts +313 -0
- package/src/api/modules/verifybar.ts +61 -0
- package/src/api/modules/worker.ts +93 -0
- package/src/api/utils.ts +206 -0
- package/src/cli/cli.ts +151 -0
- package/src/cli/editConfig.ts +943 -0
- package/src/index.ts +6 -1
- package/src/startup/compilation.ts +186 -0
- package/src/startup/dump.ts +45 -0
- package/src/startup/errorHandling.ts +38 -0
- package/src/startup/pluginLauncher.ts +261 -0
- package/LICENSE +0 -21
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { ODDebugger } from "./console";
|
|
2
|
+
import type { ODMain } from "../main";
|
|
3
|
+
/**## ODPromiseVoid `type`
|
|
4
|
+
* This is a simple type to represent a callback return value that could be a promise or not.
|
|
5
|
+
*/
|
|
6
|
+
export type ODPromiseVoid = void | Promise<void>;
|
|
7
|
+
/**## ODOptionalPromise `type`
|
|
8
|
+
* This is a simple type to represent a type as normal value or a promise value.
|
|
9
|
+
*/
|
|
10
|
+
export type ODOptionalPromise<T> = T | Promise<T>;
|
|
11
|
+
/**## ODValidButtonColor `type`
|
|
12
|
+
* This is a collection of all the possible button colors.
|
|
13
|
+
*/
|
|
14
|
+
export type ODValidButtonColor = "gray" | "red" | "green" | "blue";
|
|
15
|
+
/**## ODProjectType `type`
|
|
16
|
+
* Valid project types for using Open Discord.
|
|
17
|
+
*/
|
|
18
|
+
export type ODProjectType = "openticket" | "openmoderation";
|
|
19
|
+
/**## ODValidId `type`
|
|
20
|
+
* This is a valid Open Discord identifier. It can be an `ODId` or `string`!
|
|
21
|
+
*
|
|
22
|
+
* You will see this type in many functions from Open Discord.
|
|
23
|
+
*/
|
|
24
|
+
export type ODValidId = string | ODId;
|
|
25
|
+
/**## ODValidJsonType `type`
|
|
26
|
+
* This is a collection of all types that can be stored in a JSON file!
|
|
27
|
+
*
|
|
28
|
+
* list: `string`, `number`, `boolean`, `array`, `object`, `null`
|
|
29
|
+
*/
|
|
30
|
+
export type ODValidJsonType = string | number | boolean | object | ODValidJsonType[] | null;
|
|
31
|
+
/**## ODInterfaceWithPartialProperty `type`
|
|
32
|
+
* This is a utility type to create an interface where some properties are optional!
|
|
33
|
+
*/
|
|
34
|
+
export type ODInterfaceWithPartialProperty<Interface, Key extends keyof Interface> = Omit<Interface, Key> & Partial<Pick<Interface, Key>>;
|
|
35
|
+
/**## ODDiscordIdType `type`
|
|
36
|
+
* A list of all available discord ID types. Used in the config checker.
|
|
37
|
+
*/
|
|
38
|
+
export type ODDiscordIdType = "role" | "server" | "channel" | "category" | "user" | "member" | "interaction" | "message";
|
|
39
|
+
/**## ODId `class`
|
|
40
|
+
* This is an Open Discord identifier.
|
|
41
|
+
*
|
|
42
|
+
* It can only contain the following characters: `a-z`, `A-Z`, `0-9`, `:`, `-` & `_`
|
|
43
|
+
*
|
|
44
|
+
* You can use this class to assign a unique id when creating configs, databases, languages & more!
|
|
45
|
+
*/
|
|
46
|
+
export declare class ODId {
|
|
47
|
+
#private;
|
|
48
|
+
/**The full value of this `ODId` as a `string`. */
|
|
49
|
+
set value(id: string);
|
|
50
|
+
get value(): string;
|
|
51
|
+
constructor(id: ODValidId);
|
|
52
|
+
/**Returns a string representation of this id. (same as `this.value`) */
|
|
53
|
+
toString(): string;
|
|
54
|
+
/**The namespace of the id before `:`. (e.g. `opendiscord` for `opendiscord:autoclose-enabled`) */
|
|
55
|
+
getNamespace(): string;
|
|
56
|
+
/**The identifier of the id after `:`. (e.g. `autoclose-enabled` for `opendiscord:autoclose-enabled`) */
|
|
57
|
+
getIdentifier(): string;
|
|
58
|
+
/**Trigger an `onChange()` event in the parent `ODManager` of this class. */
|
|
59
|
+
protected _change(oldId: string, newId: string): void;
|
|
60
|
+
/****(❌ SYSTEM ONLY!!)** Set the callback executed when a value inside this class changes. */
|
|
61
|
+
changed(callback: ((oldId: string, newId: string) => void) | null): void;
|
|
62
|
+
}
|
|
63
|
+
/**## ODManagerChangeHelper `class`
|
|
64
|
+
* This is an Open Discord manager change helper.
|
|
65
|
+
*
|
|
66
|
+
* It is used to let the "onChange" event in the `ODManager` class work.
|
|
67
|
+
* You can use this class when extending your own `ODManager`
|
|
68
|
+
*/
|
|
69
|
+
export declare class ODManagerChangeHelper {
|
|
70
|
+
#private;
|
|
71
|
+
/**Trigger an `onChange()` event in the parent `ODManager` of this class. */
|
|
72
|
+
protected _change(): void;
|
|
73
|
+
/****(❌ SYSTEM ONLY!!)** Set the callback executed when a value inside this class changes. */
|
|
74
|
+
changed(callback: (() => void) | null): void;
|
|
75
|
+
}
|
|
76
|
+
/**## ODManagerData `class`
|
|
77
|
+
* This is Open Discord manager data.
|
|
78
|
+
*
|
|
79
|
+
* It provides a template for all classes that are used in the `ODManager`.
|
|
80
|
+
*
|
|
81
|
+
* There is an `id:ODId` property & also some events used in the manager.
|
|
82
|
+
*/
|
|
83
|
+
export declare class ODManagerData extends ODManagerChangeHelper {
|
|
84
|
+
/**The id of this data. */
|
|
85
|
+
id: ODId;
|
|
86
|
+
constructor(id: ODValidId);
|
|
87
|
+
}
|
|
88
|
+
/**## ODManagerCallback `type`
|
|
89
|
+
* This is a callback for the `onChange` and `onRemove` events in the `ODManager`
|
|
90
|
+
*/
|
|
91
|
+
export type ODManagerCallback<DataType extends ODManagerData> = (data: DataType) => void;
|
|
92
|
+
/**## ODManagerAddCallback `type`
|
|
93
|
+
* This is a callback for the `onAdd` event in the `ODManager`
|
|
94
|
+
*/
|
|
95
|
+
export type ODManagerAddCallback<DataType extends ODManagerData> = (data: DataType, overwritten: boolean) => void;
|
|
96
|
+
/**## ODManager `class`
|
|
97
|
+
* This is an Open Discord manager.
|
|
98
|
+
*
|
|
99
|
+
* It can be used to store & manage classes based on their `ODId`.
|
|
100
|
+
* It is somewhat the same as the default JS `Map()`.
|
|
101
|
+
* You can extend this class when creating your own classes & managers.
|
|
102
|
+
*
|
|
103
|
+
* This class has many useful functions based on `ODId` (add, get, remove, getAll, getFiltered, exists, loopAll, ...)
|
|
104
|
+
*/
|
|
105
|
+
export declare class ODManager<DataType extends ODManagerData> extends ODManagerChangeHelper {
|
|
106
|
+
#private;
|
|
107
|
+
constructor(debug?: ODDebugger, debugname?: string);
|
|
108
|
+
/**Add data to the manager. The `ODId` in the data class will be used as identifier! You can optionally select to overwrite existing data!*/
|
|
109
|
+
add(data: DataType | DataType[], overwrite?: boolean): boolean;
|
|
110
|
+
/**Get data that matches the `ODId`. Returns the found data.*/
|
|
111
|
+
get(id: ODValidId): DataType | null;
|
|
112
|
+
/**Remove data that matches the `ODId`. Returns the removed data. */
|
|
113
|
+
remove(id: ODValidId): DataType | null;
|
|
114
|
+
/**Check if data that matches the `ODId` exists. Returns a boolean. */
|
|
115
|
+
exists(id: ODValidId): boolean;
|
|
116
|
+
/**Get all data inside this manager*/
|
|
117
|
+
getAll(): DataType[];
|
|
118
|
+
/**Get all data that matches inside the filter function*/
|
|
119
|
+
getFiltered(predicate: (value: DataType, index: number, array: DataType[]) => unknown): DataType[];
|
|
120
|
+
/**Get all data where the `ODId` matches the provided RegExp. */
|
|
121
|
+
getRegex(regex: RegExp): DataType[];
|
|
122
|
+
/**Get the length/size/amount of the data inside this manager. */
|
|
123
|
+
getLength(): number;
|
|
124
|
+
/**Get a list of all the ids inside this manager*/
|
|
125
|
+
getIds(): ODId[];
|
|
126
|
+
/**Run an iterator over all data in this manager. This method also supports async-await behaviour!*/
|
|
127
|
+
loopAll(cb: (data: DataType, id: ODId) => ODPromiseVoid): Promise<void>;
|
|
128
|
+
/**Use the Open Discord debugger in this manager for logs*/
|
|
129
|
+
useDebug(debug?: ODDebugger, debugname?: string): void;
|
|
130
|
+
/**Listen for when data is added to this manager. */
|
|
131
|
+
onAdd(callback: ODManagerAddCallback<DataType>): void;
|
|
132
|
+
/**Listen for when data is changed in this manager. */
|
|
133
|
+
onChange(callback: ODManagerCallback<DataType>): void;
|
|
134
|
+
/**Listen for when data is removed from this manager. */
|
|
135
|
+
onRemove(callback: ODManagerCallback<DataType>): void;
|
|
136
|
+
}
|
|
137
|
+
/**## ODManagerWithSafety `class`
|
|
138
|
+
* This is an Open Discord safe manager.
|
|
139
|
+
*
|
|
140
|
+
* It functions exactly the same as a normal `ODManager`, but it has 1 function extra!
|
|
141
|
+
* The `getSafe()` function will always return data, because when it doesn't find an id, it returns pre-configured backup data.
|
|
142
|
+
*/
|
|
143
|
+
export declare class ODManagerWithSafety<DataType extends ODManagerData> extends ODManager<DataType> {
|
|
144
|
+
#private;
|
|
145
|
+
constructor(backupCreator: () => DataType, debug?: ODDebugger, debugname?: string);
|
|
146
|
+
/**Get data that matches the `ODId`. Returns the backup data when not found.
|
|
147
|
+
*
|
|
148
|
+
* ### ⚠️ This should only be used when the data doesn't need to be written/edited
|
|
149
|
+
*/
|
|
150
|
+
getSafe(id: ODValidId): DataType;
|
|
151
|
+
}
|
|
152
|
+
/**## ODVersionManager `class`
|
|
153
|
+
* A Open Discord version manager.
|
|
154
|
+
*
|
|
155
|
+
* It is used to manage different `ODVersion`'s from the bot. You will use it to check which version of the bot is used.
|
|
156
|
+
*/
|
|
157
|
+
export declare class ODVersionManager extends ODManager<ODVersion> {
|
|
158
|
+
constructor();
|
|
159
|
+
}
|
|
160
|
+
/**## ODVersion `class`
|
|
161
|
+
* This is an Open Discord version.
|
|
162
|
+
*
|
|
163
|
+
* It has many features like comparing versions & checking if they are compatible.
|
|
164
|
+
*
|
|
165
|
+
* You can use it in your own plugin, but most of the time you will use it to check the Open Discord version!
|
|
166
|
+
*/
|
|
167
|
+
export declare class ODVersion extends ODManagerData {
|
|
168
|
+
/**The first number of the version (example: `v1.2.3` => `1`) */
|
|
169
|
+
primary: number;
|
|
170
|
+
/**The second number of the version (example: `v1.2.3` => `2`) */
|
|
171
|
+
secondary: number;
|
|
172
|
+
/**The third number of the version (example: `v1.2.3` => `3`) */
|
|
173
|
+
tertiary: number;
|
|
174
|
+
constructor(id: ODValidId, primary: number, secondary: number, tertiary: number);
|
|
175
|
+
/**Get the version from a string (also possible with `v` prefix)
|
|
176
|
+
* @example const version = api.ODVersion.fromString("id","v1.2.3") //creates version 1.2.3
|
|
177
|
+
*/
|
|
178
|
+
static fromString(id: ODValidId, version: string): ODVersion;
|
|
179
|
+
/**Get the version as a string (`noprefix:true` => with `v` prefix)
|
|
180
|
+
* @example
|
|
181
|
+
* new api.ODVersion(1,0,0).toString(false) //returns "v1.0.0"
|
|
182
|
+
* new api.ODVersion(1,0,0).toString(true) //returns "1.0.0"
|
|
183
|
+
*/
|
|
184
|
+
toString(noprefix?: boolean): string;
|
|
185
|
+
/**Compare this version with another version and returns the result: `higher`, `lower` or `equal`
|
|
186
|
+
* @example
|
|
187
|
+
* new api.ODVersion(1,0,0).compare(new api.ODVersion(1,2,0)) //returns "lower"
|
|
188
|
+
* new api.ODVersion(1,3,0).compare(new api.ODVersion(1,2,0)) //returns "higher"
|
|
189
|
+
* new api.ODVersion(1,2,0).compare(new api.ODVersion(1,2,0)) //returns "equal"
|
|
190
|
+
*/
|
|
191
|
+
compare(comparator: ODVersion): "higher" | "lower" | "equal";
|
|
192
|
+
/**Check if this version is included in the list
|
|
193
|
+
* @example
|
|
194
|
+
* const list = [
|
|
195
|
+
* new api.ODVersion(1,0,0),
|
|
196
|
+
* new api.ODVersion(1,0,1),
|
|
197
|
+
* new api.ODVersion(1,0,2)
|
|
198
|
+
* ]
|
|
199
|
+
* new api.ODVersion(1,0,0).compatible(list) //returns true
|
|
200
|
+
* new api.ODVersion(1,0,1).compatible(list) //returns true
|
|
201
|
+
* new api.ODVersion(1,0,3).compatible(list) //returns false
|
|
202
|
+
*/
|
|
203
|
+
compatible(list: ODVersion[]): boolean;
|
|
204
|
+
/**Check if this version is higher or equal to the provided `requirement`. */
|
|
205
|
+
min(requirement: string | ODVersion): boolean;
|
|
206
|
+
/**Check if this version is lower or equal to the provided `requirement`. */
|
|
207
|
+
max(requirement: string | ODVersion): boolean;
|
|
208
|
+
/**Check if this version is matches the major version (`vX.X`) of the provided `requirement`. */
|
|
209
|
+
major(requirement: string | ODVersion): boolean;
|
|
210
|
+
/**Check if this version is matches the minor version (`vX.X.X`) of the provided `requirement`. */
|
|
211
|
+
minor(requirement: string | ODVersion): boolean;
|
|
212
|
+
}
|
|
213
|
+
/**## ODVersionMigration `class`
|
|
214
|
+
* This class is used to manage data migration between Open Ticket versions.
|
|
215
|
+
*
|
|
216
|
+
* It shouldn't be used by plugins because this is an internal API feature!
|
|
217
|
+
*/
|
|
218
|
+
export declare class ODVersionMigration {
|
|
219
|
+
#private;
|
|
220
|
+
/**The version to migrate data to */
|
|
221
|
+
version: ODVersion;
|
|
222
|
+
constructor(version: ODVersion, func: () => void | Promise<void>, afterInitFunc: () => void | Promise<void>);
|
|
223
|
+
/**Run this version migration as a plugin. Returns `false` when something goes wrong. */
|
|
224
|
+
migrate(): Promise<boolean>;
|
|
225
|
+
/**Run this version migration as a plugin (after other plugins have loaded). Returns `false` when something goes wrong. */
|
|
226
|
+
migrateAfterInit(): Promise<boolean>;
|
|
227
|
+
}
|
|
228
|
+
/**## ODHTTPGetRequest `class`
|
|
229
|
+
* This is a class that can help you with creating simple HTTP GET requests.
|
|
230
|
+
*
|
|
231
|
+
* It works using the native node.js fetch() method. You can configure all options in the constructor!
|
|
232
|
+
* @example
|
|
233
|
+
* const request = new api.ODHTTPGetRequest("https://www.example.com/abc.txt",false,{})
|
|
234
|
+
*
|
|
235
|
+
* const result = await request.run()
|
|
236
|
+
* result.body //the response body (string)
|
|
237
|
+
* result.status //the response code (number)
|
|
238
|
+
* result.response //the full response (object)
|
|
239
|
+
*/
|
|
240
|
+
export declare class ODHTTPGetRequest {
|
|
241
|
+
/**The url used in the request */
|
|
242
|
+
url: string;
|
|
243
|
+
/**The request config for additional options */
|
|
244
|
+
config: RequestInit;
|
|
245
|
+
/**Throw on error OR return http code 500 */
|
|
246
|
+
throwOnError: boolean;
|
|
247
|
+
constructor(main: ODMain, url: string, throwOnError: boolean, config?: RequestInit);
|
|
248
|
+
/**Execute the GET request.*/
|
|
249
|
+
run(): Promise<{
|
|
250
|
+
status: number;
|
|
251
|
+
body: string;
|
|
252
|
+
response?: Response;
|
|
253
|
+
}>;
|
|
254
|
+
}
|
|
255
|
+
/**## ODHTTPPostRequest `class`
|
|
256
|
+
* This is a class that can help you with creating simple HTTP POST requests.
|
|
257
|
+
*
|
|
258
|
+
* It works using the native node.js fetch() method. You can configure all options in the constructor!
|
|
259
|
+
* @example
|
|
260
|
+
* const request = new api.ODHTTPPostRequest("https://www.example.com/abc.txt",false,{})
|
|
261
|
+
*
|
|
262
|
+
* const result = await request.run()
|
|
263
|
+
* result.body //the response body (string)
|
|
264
|
+
* result.status //the response code (number)
|
|
265
|
+
* result.response //the full response (object)
|
|
266
|
+
*/
|
|
267
|
+
export declare class ODHTTPPostRequest {
|
|
268
|
+
/**The url used in the request */
|
|
269
|
+
url: string;
|
|
270
|
+
/**The request config for additional options */
|
|
271
|
+
config: RequestInit;
|
|
272
|
+
/**Throw on error OR return http code 500 */
|
|
273
|
+
throwOnError: boolean;
|
|
274
|
+
constructor(main: ODMain, url: string, throwOnError: boolean, config?: RequestInit);
|
|
275
|
+
/**Execute the POST request.*/
|
|
276
|
+
run(): Promise<{
|
|
277
|
+
status: number;
|
|
278
|
+
body: string;
|
|
279
|
+
response?: Response;
|
|
280
|
+
}>;
|
|
281
|
+
}
|
|
282
|
+
/**## ODEnvHelper `class`
|
|
283
|
+
* This is a utility class that helps you with reading the ENV.
|
|
284
|
+
*
|
|
285
|
+
* It has support for the built-in `process.env` & `.env` file
|
|
286
|
+
* @example
|
|
287
|
+
* const envHelper = new api.ODEnvHelper()
|
|
288
|
+
*
|
|
289
|
+
* const variableA = envHelper.getVariable("value-a")
|
|
290
|
+
* const variableB = envHelper.getVariable("value-b","dotenv") //only get from .env
|
|
291
|
+
* const variableA = envHelper.getVariable("value-c","env") //only get from process.env
|
|
292
|
+
*/
|
|
293
|
+
export declare class ODEnvHelper {
|
|
294
|
+
#private;
|
|
295
|
+
/**All variables found in the `.env` file */
|
|
296
|
+
dotenv: object;
|
|
297
|
+
/**All variables found in `process.env` */
|
|
298
|
+
env: object;
|
|
299
|
+
constructor(customEnvPath?: string);
|
|
300
|
+
/**Get a variable from the env */
|
|
301
|
+
getVariable(name: string, source?: "dotenv" | "env"): any | undefined;
|
|
302
|
+
}
|
|
303
|
+
/**## ODSystemError `class`
|
|
304
|
+
* A wrapper for the node.js `Error` class that makes the error look better in the console!
|
|
305
|
+
*
|
|
306
|
+
* This wrapper is made for Open Discord system errors! **It can only be used by Open Discord itself!**
|
|
307
|
+
*/
|
|
308
|
+
export declare class ODSystemError extends Error {
|
|
309
|
+
/**This variable gets detected by the error handling system to know how to render it */
|
|
310
|
+
_ODErrorType: string;
|
|
311
|
+
/**Create an `ODSystemError` directly from an `Error` class */
|
|
312
|
+
static fromError(err: Error): ODSystemError;
|
|
313
|
+
}
|
|
314
|
+
/**## ODPluginError `class`
|
|
315
|
+
* A wrapper for the node.js `Error` class that makes the error look better in the console!
|
|
316
|
+
*
|
|
317
|
+
* This wrapper is made for Open Discord plugin errors! **It can only be used by plugins!**
|
|
318
|
+
*/
|
|
319
|
+
export declare class ODPluginError extends Error {
|
|
320
|
+
/**This variable gets detected by the error handling system to know how to render it */
|
|
321
|
+
_ODErrorType: string;
|
|
322
|
+
/**Create an `ODPluginError` directly from an `Error` class */
|
|
323
|
+
static fromError(err: Error): ODPluginError;
|
|
324
|
+
}
|
|
325
|
+
/**Oh, what could this be `¯\_(ツ)_/¯` */
|
|
326
|
+
export interface ODEasterEggs {
|
|
327
|
+
creator: string;
|
|
328
|
+
translators: string[];
|
|
329
|
+
}
|