@open-discord-bots/framework 0.2.11 → 0.2.13

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.
Files changed (107) hide show
  1. package/dist/api/index.d.ts +26 -26
  2. package/dist/api/index.js +26 -42
  3. package/dist/api/main.d.ts +24 -24
  4. package/dist/api/main.js +7 -11
  5. package/dist/api/modules/action.d.ts +12 -12
  6. package/dist/api/modules/action.js +11 -17
  7. package/dist/api/modules/base.d.ts +7 -5
  8. package/dist/api/modules/base.js +22 -67
  9. package/dist/api/modules/builder.d.ts +44 -44
  10. package/dist/api/modules/builder.js +81 -142
  11. package/dist/api/modules/checker.d.ts +7 -7
  12. package/dist/api/modules/checker.js +55 -87
  13. package/dist/api/modules/client.d.ts +4 -4
  14. package/dist/api/modules/client.js +71 -118
  15. package/dist/api/modules/code.d.ts +2 -2
  16. package/dist/api/modules/code.js +3 -8
  17. package/dist/api/modules/config.d.ts +2 -2
  18. package/dist/api/modules/config.js +21 -63
  19. package/dist/api/modules/console.d.ts +16 -16
  20. package/dist/api/modules/console.js +61 -83
  21. package/dist/api/modules/cooldown.d.ts +2 -2
  22. package/dist/api/modules/cooldown.js +13 -23
  23. package/dist/api/modules/database.d.ts +2 -2
  24. package/dist/api/modules/database.js +19 -29
  25. package/dist/api/modules/event.d.ts +2 -2
  26. package/dist/api/modules/event.js +6 -11
  27. package/dist/api/modules/flag.d.ts +2 -2
  28. package/dist/api/modules/flag.js +3 -8
  29. package/dist/api/modules/fuse.js +2 -7
  30. package/dist/api/modules/helpmenu.d.ts +2 -2
  31. package/dist/api/modules/helpmenu.js +8 -16
  32. package/dist/api/modules/language.d.ts +2 -2
  33. package/dist/api/modules/language.js +12 -21
  34. package/dist/api/modules/permission.d.ts +3 -3
  35. package/dist/api/modules/permission.js +9 -47
  36. package/dist/api/modules/plugin.d.ts +2 -2
  37. package/dist/api/modules/plugin.js +9 -18
  38. package/dist/api/modules/post.d.ts +3 -3
  39. package/dist/api/modules/post.js +3 -8
  40. package/dist/api/modules/progressbar.d.ts +2 -2
  41. package/dist/api/modules/progressbar.js +14 -26
  42. package/dist/api/modules/responder.d.ts +42 -42
  43. package/dist/api/modules/responder.js +79 -138
  44. package/dist/api/modules/session.d.ts +2 -2
  45. package/dist/api/modules/session.js +4 -42
  46. package/dist/api/modules/startscreen.d.ts +4 -4
  47. package/dist/api/modules/startscreen.js +28 -44
  48. package/dist/api/modules/statistic.d.ts +3 -3
  49. package/dist/api/modules/statistic.js +11 -22
  50. package/dist/api/modules/verifybar.d.ts +5 -5
  51. package/dist/api/modules/verifybar.js +6 -11
  52. package/dist/api/modules/worker.d.ts +15 -15
  53. package/dist/api/modules/worker.js +12 -17
  54. package/dist/cli/editConfig.d.ts +2 -2
  55. package/dist/cli/editConfig.js +194 -248
  56. package/dist/cli/index.d.ts +2 -2
  57. package/dist/cli/index.js +37 -62
  58. package/dist/index.d.ts +4 -4
  59. package/dist/index.js +6 -13
  60. package/dist/startup/compilation.d.ts +1 -1
  61. package/dist/startup/compilation.js +35 -42
  62. package/dist/startup/dump.d.ts +1 -1
  63. package/dist/startup/dump.js +4 -41
  64. package/dist/startup/errorHandling.d.ts +1 -1
  65. package/dist/startup/errorHandling.js +2 -38
  66. package/dist/startup/pluginLauncher.d.ts +1 -1
  67. package/dist/startup/pluginLauncher.js +14 -52
  68. package/dist/utilities/index.d.ts +3 -3
  69. package/dist/utilities/index.js +20 -71
  70. package/package.json +5 -4
  71. package/src/api/index.ts +26 -26
  72. package/src/api/main.ts +25 -25
  73. package/src/api/modules/action.ts +13 -13
  74. package/src/api/modules/base.ts +14 -10
  75. package/src/api/modules/builder.ts +56 -56
  76. package/src/api/modules/checker.ts +7 -7
  77. package/src/api/modules/client.ts +18 -18
  78. package/src/api/modules/code.ts +2 -2
  79. package/src/api/modules/component.txt +350 -0
  80. package/src/api/modules/config.ts +3 -3
  81. package/src/api/modules/console.ts +28 -28
  82. package/src/api/modules/cooldown.ts +2 -2
  83. package/src/api/modules/database.ts +3 -3
  84. package/src/api/modules/event.ts +5 -5
  85. package/src/api/modules/flag.ts +2 -2
  86. package/src/api/modules/helpmenu.ts +4 -4
  87. package/src/api/modules/language.ts +3 -3
  88. package/src/api/modules/permission.ts +3 -3
  89. package/src/api/modules/plugin.ts +4 -4
  90. package/src/api/modules/post.ts +3 -3
  91. package/src/api/modules/progressbar.ts +5 -3
  92. package/src/api/modules/responder.ts +48 -48
  93. package/src/api/modules/session.ts +2 -2
  94. package/src/api/modules/startscreen.ts +4 -4
  95. package/src/api/modules/statistic.ts +3 -4
  96. package/src/api/modules/verifybar.ts +5 -5
  97. package/src/api/modules/worker.ts +25 -25
  98. package/src/cli/editConfig.ts +23 -37
  99. package/src/cli/index.ts +3 -3
  100. package/src/index.ts +5 -5
  101. package/src/startup/compilation.ts +2 -2
  102. package/src/startup/dump.ts +2 -2
  103. package/src/startup/errorHandling.ts +2 -2
  104. package/src/startup/pluginLauncher.ts +11 -8
  105. package/src/utilities/index.ts +4 -4
  106. package/tools/cleanup.js +1 -1
  107. package/tsconfig.json +2 -1
@@ -1,14 +1,8 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ODPluginClassManager = exports.ODPlugin = exports.ODPluginManager = void 0;
7
1
  ///////////////////////////////////////
8
2
  //PLUGIN MODULE
9
3
  ///////////////////////////////////////
10
- const base_1 = require("./base");
11
- const path_1 = __importDefault(require("path"));
4
+ import { ODId, ODManager, ODManagerData, ODVersion } from "./base.js";
5
+ import nodepath from "path";
12
6
  /**## ODPluginManager `class`
13
7
  * This is an Open Discord plugin manager.
14
8
  *
@@ -18,7 +12,7 @@ const path_1 = __importDefault(require("path"));
18
12
  *
19
13
  * Use `isPluginLoaded()` to check if a plugin has been loaded.
20
14
  */
21
- class ODPluginManager extends base_1.ODManager {
15
+ export class ODPluginManager extends ODManager {
22
16
  /**A manager for all custom managers registered by plugins. */
23
17
  classes;
24
18
  /**A list of basic details from all plugins that crashed while loading the `plugin.json` file. */
@@ -29,7 +23,7 @@ class ODPluginManager extends base_1.ODManager {
29
23
  }
30
24
  /**Check if a plugin has been loaded successfully and is available for usage.*/
31
25
  isPluginLoaded(id) {
32
- const newId = new base_1.ODId(id);
26
+ const newId = new ODId(id);
33
27
  const plugin = this.get(newId);
34
28
  return (plugin !== null && plugin.executed);
35
29
  }
@@ -43,7 +37,6 @@ class ODPluginManager extends base_1.ODManager {
43
37
  return super.exists(id);
44
38
  }
45
39
  }
46
- exports.ODPluginManager = ODPluginManager;
47
40
  /**## ODPlugin `class`
48
41
  * This is an Open Discord plugin.
49
42
  *
@@ -52,7 +45,7 @@ exports.ODPluginManager = ODPluginManager;
52
45
  *
53
46
  * Don't re-execute plugins which are already enabled! It might break the bot or plugin.
54
47
  */
55
- class ODPlugin extends base_1.ODManagerData {
48
+ export class ODPlugin extends ODManagerData {
56
49
  /**The name of the directory of this plugin. (same as id) */
57
50
  dir;
58
51
  /**All plugin data found in the `plugin.json` file. */
@@ -79,7 +72,7 @@ class ODPlugin extends base_1.ODManagerData {
79
72
  this.data = jsondata;
80
73
  this.name = jsondata.name;
81
74
  this.priority = jsondata.priority;
82
- this.version = base_1.ODVersion.fromString("plugin", jsondata.version);
75
+ this.version = ODVersion.fromString("plugin", jsondata.version);
83
76
  this.details = jsondata.details;
84
77
  this.enabled = jsondata.enabled;
85
78
  this.executed = false;
@@ -88,14 +81,14 @@ class ODPlugin extends base_1.ODManagerData {
88
81
  /**Get the startfile location relative to the `./plugins/` directory. (`./dist/plugins/`) when compiled) */
89
82
  getStartFile() {
90
83
  const newFile = this.data.startFile.replace(/\.ts$/, ".js");
91
- return path_1.default.join(this.dir, newFile);
84
+ return nodepath.join(this.dir, newFile);
92
85
  }
93
86
  /**Execute this plugin. Returns `false` on crash. */
94
87
  async execute(debug, force) {
95
88
  if ((this.enabled && !this.crashed) || force) {
96
89
  try {
97
90
  //import relative plugin directory path (works on windows & unix based systems)
98
- const pluginPath = path_1.default.join("../../../../plugins/", this.getStartFile()).replaceAll("\\", "/");
91
+ const pluginPath = nodepath.join(process.cwd(), "./dist/plugins/", this.getStartFile()).replaceAll("\\", "/");
99
92
  await import(pluginPath);
100
93
  debug.console.log("Plugin \"" + this.id.value + "\" loaded successfully!", "plugin");
101
94
  this.executed = true;
@@ -162,7 +155,6 @@ class ODPlugin extends base_1.ODManagerData {
162
155
  return [this.details.author, ...(this.details.contributors ?? [])];
163
156
  }
164
157
  }
165
- exports.ODPlugin = ODPlugin;
166
158
  /**## ODPluginClassManager `class`
167
159
  * This is an Open Discord plugin class manager.
168
160
  *
@@ -173,7 +165,7 @@ exports.ODPlugin = ODPlugin;
173
165
  *
174
166
  * Use `isPluginLoaded()` to check if a plugin has been loaded before trying to access the manager.
175
167
  */
176
- class ODPluginClassManager extends base_1.ODManager {
168
+ export class ODPluginClassManager extends ODManager {
177
169
  constructor(debug) {
178
170
  super(debug, "plugin class");
179
171
  }
@@ -187,4 +179,3 @@ class ODPluginClassManager extends base_1.ODManager {
187
179
  return super.exists(id);
188
180
  }
189
181
  }
190
- exports.ODPluginClassManager = ODPluginClassManager;
@@ -1,6 +1,6 @@
1
- import { ODManager, ODManagerData, ODNoGeneric, ODValidId } from "./base";
2
- import { ODMessageBuildResult, ODMessageBuildSentResult } from "./builder";
3
- import { ODDebugger } from "./console";
1
+ import { ODManager, ODManagerData, ODNoGeneric, ODValidId } from "./base.js";
2
+ import { ODMessageBuildResult, ODMessageBuildSentResult } from "./builder.js";
3
+ import { ODDebugger } from "./console.js";
4
4
  import * as discord from "discord.js";
5
5
  /**## ODPostManagerIdConstraint `type`
6
6
  * The constraint/layout for id mappings/interfaces of the `ODPostManager` class.
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ODPost = exports.ODPostManager = void 0;
4
1
  ///////////////////////////////////////
5
2
  //POST MODULE
6
3
  ///////////////////////////////////////
7
- const base_1 = require("./base");
4
+ import { ODManager, ODManagerData } from "./base.js";
8
5
  /**## ODPostManager `class`
9
6
  * This is an Open Discord post manager.
10
7
  *
@@ -12,7 +9,7 @@ const base_1 = require("./base");
12
9
  *
13
10
  * You can use this to get the logs channel of the bot (or some other static channel/category).
14
11
  */
15
- class ODPostManager extends base_1.ODManager {
12
+ export class ODPostManager extends ODManager {
16
13
  /**A reference to the main server of the bot */
17
14
  #guild = null;
18
15
  constructor(debug) {
@@ -41,7 +38,6 @@ class ODPostManager extends base_1.ODManager {
41
38
  return super.exists(id);
42
39
  }
43
40
  }
44
- exports.ODPostManager = ODPostManager;
45
41
  /**## ODPost `class`
46
42
  * This is an Open Discord post class.
47
43
  *
@@ -50,7 +46,7 @@ exports.ODPostManager = ODPostManager;
50
46
  *
51
47
  * This class also contains utilities for sending messages via the Open Discord builders.
52
48
  */
53
- class ODPost extends base_1.ODManagerData {
49
+ export class ODPost extends ODManagerData {
54
50
  /**A reference to the main server of the bot */
55
51
  #guild = null;
56
52
  /**Is this post already initialized? */
@@ -98,4 +94,3 @@ class ODPost extends base_1.ODManagerData {
98
94
  }
99
95
  }
100
96
  }
101
- exports.ODPost = ODPost;
@@ -1,5 +1,5 @@
1
- import { ODManager, ODManagerData, ODValidId, ODNoGeneric } from "./base";
2
- import { ODDebugger, ODValidConsoleColor } from "./console";
1
+ import { ODManager, ODManagerData, ODValidId, ODNoGeneric } from "./base.js";
2
+ import { ODDebugger, ODValidConsoleColor } from "./console.js";
3
3
  /**## ODProgressBarRendererManagerIdConstraint `type`
4
4
  * The constraint/layout for id mappings/interfaces of the `ODProgressBarRendererManager` class.
5
5
  */
@@ -1,15 +1,9 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ODDefaultProgressBarRenderer = exports.ODManualProgressBar = exports.ODTimedProgressBar = exports.ODProgressBar = exports.ODProgressBarRenderer = exports.ODProgressBarManager = exports.ODProgressBarRendererManager = void 0;
7
1
  ///////////////////////////////////////
8
2
  //PROGRESS BAR MODULE
9
3
  ///////////////////////////////////////
10
- const base_1 = require("./base");
11
- const readline_1 = __importDefault(require("readline"));
12
- const ansis_1 = __importDefault(require("ansis"));
4
+ import { ODManager, ODManagerData } from "./base.js";
5
+ import readline from "readline";
6
+ import ansis from "ansis";
13
7
  /**## ODProgressBarRendererManager `class`
14
8
  * This is an Open Discord progress bar renderer manager.
15
9
  *
@@ -17,7 +11,7 @@ const ansis_1 = __importDefault(require("ansis"));
17
11
  *
18
12
  * A renderer is a function which will try to visualize the progress bar in the console.
19
13
  */
20
- class ODProgressBarRendererManager extends base_1.ODManager {
14
+ export class ODProgressBarRendererManager extends ODManager {
21
15
  constructor(debug) {
22
16
  super(debug, "progress bar renderer");
23
17
  }
@@ -31,7 +25,6 @@ class ODProgressBarRendererManager extends base_1.ODManager {
31
25
  return super.exists(id);
32
26
  }
33
27
  }
34
- exports.ODProgressBarRendererManager = ODProgressBarRendererManager;
35
28
  /**## ODProgressBarManager `class`
36
29
  * This is an Open Discord progress bar manager.
37
30
  *
@@ -39,7 +32,7 @@ exports.ODProgressBarRendererManager = ODProgressBarRendererManager;
39
32
  *
40
33
  * There are many types of progress bars available, but you can also create your own!
41
34
  */
42
- class ODProgressBarManager extends base_1.ODManager {
35
+ export class ODProgressBarManager extends ODManager {
43
36
  /**A collection of render types for progress bars. */
44
37
  renderers;
45
38
  constructor(debug) {
@@ -56,7 +49,6 @@ class ODProgressBarManager extends base_1.ODManager {
56
49
  return super.exists(id);
57
50
  }
58
51
  }
59
- exports.ODProgressBarManager = ODProgressBarManager;
60
52
  /**## ODProgressBarRenderer `class`
61
53
  * This is an Open Discord console progress bar renderer.
62
54
  *
@@ -64,7 +56,7 @@ exports.ODProgressBarManager = ODProgressBarManager;
64
56
  *
65
57
  * There are already a lot of default options available if you just want an easy progress bar!
66
58
  */
67
- class ODProgressBarRenderer extends base_1.ODManagerData {
59
+ export class ODProgressBarRenderer extends ODManagerData {
68
60
  settings;
69
61
  #render;
70
62
  constructor(id, render, settings) {
@@ -88,10 +80,10 @@ class ODProgressBarRenderer extends base_1.ODManagerData {
88
80
  if (typeof settings[key] != "undefined")
89
81
  newSettings[key] = settings[key];
90
82
  }
83
+ const idk = Object.keys(settings);
91
84
  return new ODProgressBarRenderer(this.id, this.#render, newSettings);
92
85
  }
93
86
  }
94
- exports.ODProgressBarRenderer = ODProgressBarRenderer;
95
87
  /**## ODProgressBar `class`
96
88
  * This is an Open Discord console progress bar.
97
89
  *
@@ -100,7 +92,7 @@ exports.ODProgressBarRenderer = ODProgressBarRenderer;
100
92
  *
101
93
  * Use other classes as existing templates or create your own progress bar from scratch using this class.
102
94
  */
103
- class ODProgressBar extends base_1.ODManagerData {
95
+ export class ODProgressBar extends ODManagerData {
104
96
  /**The renderer of this progress bar. */
105
97
  renderer;
106
98
  /**Is this progress bar currently active? */
@@ -145,8 +137,8 @@ class ODProgressBar extends base_1.ODManagerData {
145
137
  #renderStdout() {
146
138
  if (!this.#active)
147
139
  return;
148
- readline_1.default.clearLine(process.stdout, 0);
149
- readline_1.default.cursorTo(process.stdout, 0);
140
+ readline.clearLine(process.stdout, 0);
141
+ readline.cursorTo(process.stdout, 0);
150
142
  process.stdout.write(this.renderer.render(this.min, this.max, this.value, this.prefix, this.suffix));
151
143
  }
152
144
  /**Start showing this progress bar in the console. */
@@ -179,14 +171,13 @@ class ODProgressBar extends base_1.ODManagerData {
179
171
  });
180
172
  }
181
173
  }
182
- exports.ODProgressBar = ODProgressBar;
183
174
  /**## ODTimedProgressBar `class`
184
175
  * This is an Open Discord timed console progress bar.
185
176
  *
186
177
  * It is used to create a simple timed progress bar in the console.
187
178
  * You can set a fixed duration (milliseconds) in the constructor.
188
179
  */
189
- class ODTimedProgressBar extends ODProgressBar {
180
+ export class ODTimedProgressBar extends ODProgressBar {
190
181
  /**The time in milliseconds. */
191
182
  time;
192
183
  /**The mode of the timer. */
@@ -222,14 +213,13 @@ class ODTimedProgressBar extends ODProgressBar {
222
213
  return true;
223
214
  }
224
215
  }
225
- exports.ODTimedProgressBar = ODTimedProgressBar;
226
216
  /**## ODManualProgressBar `class`
227
217
  * This is an Open Discord manual console progress bar.
228
218
  *
229
219
  * It is used to create a simple manual progress bar in the console.
230
220
  * You can update the progress manually using `update()`.
231
221
  */
232
- class ODManualProgressBar extends ODProgressBar {
222
+ export class ODManualProgressBar extends ODProgressBar {
233
223
  constructor(id, renderer, amount, autoStop, prefix, suffix) {
234
224
  super(id, renderer, 0, amount, 0, autoStop, prefix, suffix);
235
225
  }
@@ -250,8 +240,7 @@ class ODManualProgressBar extends ODProgressBar {
250
240
  super.update(this.value - amount, stop);
251
241
  }
252
242
  }
253
- exports.ODManualProgressBar = ODManualProgressBar;
254
- class ODDefaultProgressBarRenderer extends ODProgressBarRenderer {
243
+ export class ODDefaultProgressBarRenderer extends ODProgressBarRenderer {
255
244
  constructor(id, settings) {
256
245
  super(id, (settings, min, max, value, rawPrefix, rawSuffix) => {
257
246
  const percentage = (value - min) / (max - min);
@@ -288,7 +277,6 @@ class ODDefaultProgressBarRenderer extends ODProgressBarRenderer {
288
277
  }
289
278
  /**Switch between Ansis functions based on the specified color. */
290
279
  #switchColorAnsis(c) {
291
- return (c === "openticket") ? ansis_1.default.hex("#f8ba00") : (c === "openmoderation") ? ansis_1.default.hex("#1690ff") : ansis_1.default[c];
280
+ return (c === "openticket") ? ansis.hex("#f8ba00") : (c === "openmoderation") ? ansis.hex("#1690ff") : ansis[c];
292
281
  }
293
282
  }
294
- exports.ODDefaultProgressBarRenderer = ODDefaultProgressBarRenderer;
@@ -1,9 +1,9 @@
1
- import { ODManager, ODValidId, ODManagerData, ODNoGeneric } from "./base";
1
+ import { ODManager, ODValidId, ODManagerData, ODNoGeneric } from "./base.js";
2
2
  import * as discord from "discord.js";
3
- import { ODWorkerManager, ODWorkerCallback } from "./worker";
4
- import { ODDebugger } from "./console";
5
- import { ODClientManager, ODContextMenu, ODSlashCommand, ODTextCommand, ODTextCommandInteractionOption } from "./client";
6
- import { ODDropdownData, ODMessageBuildResult, ODMessageBuildSentResult, ODModalBuildResult } from "./builder";
3
+ import { ODWorkerManager, ODWorkerCallback } from "./worker.js";
4
+ import { ODDebugger } from "./console.js";
5
+ import { ODClientManager, ODContextMenu, ODSlashCommand, ODTextCommand, ODTextCommandInteractionOption } from "./client.js";
6
+ import { ODDropdownData, ODMessageBuildResult, ODMessageBuildSentResult, ODModalBuildResult } from "./builder.js";
7
7
  /**## ODResponderImplementation `class`
8
8
  * This is an Open Discord responder implementation.
9
9
  *
@@ -11,19 +11,19 @@ import { ODDropdownData, ODMessageBuildResult, ODMessageBuildSentResult, ODModal
11
11
  *
12
12
  * This class can't be used stand-alone & needs to be extended from!
13
13
  */
14
- export declare class ODResponderImplementation<Instance, Source extends string, Params, WorkerIds extends string = string> extends ODManagerData {
14
+ export declare class ODResponderImplementation<Instance, Origin extends string, Params, WorkerIds extends string = string> extends ODManagerData {
15
15
  /**The manager that has all workers of this implementation */
16
- workers: ODWorkerManager<Instance, Source, Params, WorkerIds>;
16
+ workers: ODWorkerManager<Instance, Origin, Params, WorkerIds>;
17
17
  /**The `commandName` or `customId` needs to match this string or regex for this responder to be executed. */
18
18
  match: string | RegExp;
19
- constructor(id: ODValidId, match: string | RegExp, callback?: ODWorkerCallback<Instance, Source, Params>, priority?: number, callbackId?: ODValidId);
19
+ constructor(id: ODValidId, match: string | RegExp, callback?: ODWorkerCallback<Instance, Origin, Params>, priority?: number, callbackId?: ODValidId);
20
20
  /**Execute all workers & return the result. */
21
- respond(instance: Instance, source: Source, params: Params): Promise<void>;
21
+ respond(instance: Instance, origin: Origin, params: Params): Promise<void>;
22
22
  }
23
23
  /**## ODResponderTimeoutErrorCallback `type`
24
24
  * This is the callback for the responder timeout function. It will be executed when something went wrong or the action takes too much time.
25
25
  */
26
- export type ODResponderTimeoutErrorCallback<Instance, Source extends "slash" | "text" | "button" | "dropdown" | "modal" | "other" | "context-menu" | "autocomplete"> = (instance: Instance, source: Source) => void | Promise<void>;
26
+ export type ODResponderTimeoutErrorCallback<Instance, Origin extends "slash" | "text" | "button" | "dropdown" | "modal" | "other" | "context-menu" | "autocomplete"> = (instance: Instance, origin: Origin) => void | Promise<void>;
27
27
  /**## ODResponderManager `class`
28
28
  * This is an Open Discord responder manager.
29
29
  *
@@ -57,7 +57,7 @@ export declare class ODResponderManager<CommandIdList extends ODCommandResponder
57
57
  * The constraint/layout for id mappings/interfaces of the `ODCommandResponderManager` class.
58
58
  */
59
59
  export type ODCommandResponderManagerIdConstraint = Record<string, {
60
- source: "slash" | "text";
60
+ origin: "slash" | "text";
61
61
  params: object;
62
62
  workers: string;
63
63
  }>;
@@ -81,9 +81,9 @@ export declare class ODCommandResponderManager<IdList extends ODCommandResponder
81
81
  /**Set the message to send when the response times out! */
82
82
  setTimeoutErrorCallback(callback: ODResponderTimeoutErrorCallback<ODCommandResponderInstance, "slash" | "text"> | null, ms: number | null): void;
83
83
  add(data: ODCommandResponder<"slash" | "text", any>, overwrite?: boolean): boolean;
84
- get<CommandResponderId extends keyof ODNoGeneric<IdList>>(id: CommandResponderId): ODCommandResponder<IdList[CommandResponderId]["source"], IdList[CommandResponderId]["params"], IdList[CommandResponderId]["workers"]>;
84
+ get<CommandResponderId extends keyof ODNoGeneric<IdList>>(id: CommandResponderId): ODCommandResponder<IdList[CommandResponderId]["origin"], IdList[CommandResponderId]["params"], IdList[CommandResponderId]["workers"]>;
85
85
  get(id: ODValidId): ODCommandResponder<"slash" | "text", any> | null;
86
- remove<CommandResponderId extends keyof ODNoGeneric<IdList>>(id: CommandResponderId): ODCommandResponder<IdList[CommandResponderId]["source"], IdList[CommandResponderId]["params"], IdList[CommandResponderId]["workers"]>;
86
+ remove<CommandResponderId extends keyof ODNoGeneric<IdList>>(id: CommandResponderId): ODCommandResponder<IdList[CommandResponderId]["origin"], IdList[CommandResponderId]["params"], IdList[CommandResponderId]["workers"]>;
87
87
  remove(id: ODValidId): ODCommandResponder<"slash" | "text", any> | null;
88
88
  exists(id: keyof ODNoGeneric<IdList>): boolean;
89
89
  exists(id: ODValidId): boolean;
@@ -162,18 +162,18 @@ export declare class ODCommandResponderInstance {
162
162
  *
163
163
  * This class manages all workers which are executed when the related command is triggered.
164
164
  */
165
- export declare class ODCommandResponder<Source extends "slash" | "text", Params, WorkerIds extends string = string> extends ODResponderImplementation<ODCommandResponderInstance, Source, Params, WorkerIds> {
165
+ export declare class ODCommandResponder<Origin extends "slash" | "text", Params, WorkerIds extends string = string> extends ODResponderImplementation<ODCommandResponderInstance, Origin, Params, WorkerIds> {
166
166
  /**The prefix of the text command needs to match this */
167
167
  prefix: string;
168
- constructor(id: ODValidId, prefix: string, match: string | RegExp, callback?: ODWorkerCallback<ODCommandResponderInstance, Source, Params>, priority?: number, callbackId?: ODValidId);
168
+ constructor(id: ODValidId, prefix: string, match: string | RegExp, callback?: ODWorkerCallback<ODCommandResponderInstance, Origin, Params>, priority?: number, callbackId?: ODValidId);
169
169
  /**Respond to this command */
170
- respond(instance: ODCommandResponderInstance, source: Source, params: Params): Promise<void>;
170
+ respond(instance: ODCommandResponderInstance, origin: Origin, params: Params): Promise<void>;
171
171
  }
172
172
  /**## ODButtonResponderManagerIdConstraint `type`
173
173
  * The constraint/layout for id mappings/interfaces of the `ODButtonResponderManager` class.
174
174
  */
175
175
  export type ODButtonResponderManagerIdConstraint = Record<string, {
176
- source: "button";
176
+ origin: "button";
177
177
  params: object;
178
178
  workers: string;
179
179
  }>;
@@ -196,9 +196,9 @@ export declare class ODButtonResponderManager<IdList extends ODButtonResponderMa
196
196
  /**Set the message to send when the response times out! */
197
197
  setTimeoutErrorCallback(callback: ODResponderTimeoutErrorCallback<ODButtonResponderInstance, "button"> | null, ms: number | null): void;
198
198
  add(data: ODButtonResponder<"button", any>, overwrite?: boolean): boolean;
199
- get<ButtonResponderId extends keyof ODNoGeneric<IdList>>(id: ButtonResponderId): ODButtonResponder<IdList[ButtonResponderId]["source"], IdList[ButtonResponderId]["params"], IdList[ButtonResponderId]["workers"]>;
199
+ get<ButtonResponderId extends keyof ODNoGeneric<IdList>>(id: ButtonResponderId): ODButtonResponder<IdList[ButtonResponderId]["origin"], IdList[ButtonResponderId]["params"], IdList[ButtonResponderId]["workers"]>;
200
200
  get(id: ODValidId): ODButtonResponder<"button", any> | null;
201
- remove<ButtonResponderId extends keyof ODNoGeneric<IdList>>(id: ButtonResponderId): ODButtonResponder<IdList[ButtonResponderId]["source"], IdList[ButtonResponderId]["params"], IdList[ButtonResponderId]["workers"]>;
201
+ remove<ButtonResponderId extends keyof ODNoGeneric<IdList>>(id: ButtonResponderId): ODButtonResponder<IdList[ButtonResponderId]["origin"], IdList[ButtonResponderId]["params"], IdList[ButtonResponderId]["workers"]>;
202
202
  remove(id: ODValidId): ODButtonResponder<"button", any> | null;
203
203
  exists(id: keyof ODNoGeneric<IdList>): boolean;
204
204
  exists(id: ODValidId): boolean;
@@ -247,15 +247,15 @@ export declare class ODButtonResponderInstance {
247
247
  *
248
248
  * This class manages all workers which are executed when the related button is triggered.
249
249
  */
250
- export declare class ODButtonResponder<Source extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODButtonResponderInstance, Source, Params, WorkerIds> {
250
+ export declare class ODButtonResponder<Origin extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODButtonResponderInstance, Origin, Params, WorkerIds> {
251
251
  /**Respond to this button */
252
- respond(instance: ODButtonResponderInstance, source: Source, params: Params): Promise<void>;
252
+ respond(instance: ODButtonResponderInstance, origin: Origin, params: Params): Promise<void>;
253
253
  }
254
254
  /**## ODDropdownResponderManagerIdConstraint `type`
255
255
  * The constraint/layout for id mappings/interfaces of the `ODDropdownResponderManager` class.
256
256
  */
257
257
  export type ODDropdownResponderManagerIdConstraint = Record<string, {
258
- source: "dropdown";
258
+ origin: "dropdown";
259
259
  params: object;
260
260
  workers: string;
261
261
  }>;
@@ -278,9 +278,9 @@ export declare class ODDropdownResponderManager<IdList extends ODDropdownRespond
278
278
  /**Set the message to send when the response times out! */
279
279
  setTimeoutErrorCallback(callback: ODResponderTimeoutErrorCallback<ODDropdownResponderInstance, "dropdown"> | null, ms: number | null): void;
280
280
  add(data: ODDropdownResponder<"dropdown", any>, overwrite?: boolean): boolean;
281
- get<DropdownResponderId extends keyof ODNoGeneric<IdList>>(id: DropdownResponderId): ODDropdownResponder<IdList[DropdownResponderId]["source"], IdList[DropdownResponderId]["params"], IdList[DropdownResponderId]["workers"]>;
281
+ get<DropdownResponderId extends keyof ODNoGeneric<IdList>>(id: DropdownResponderId): ODDropdownResponder<IdList[DropdownResponderId]["origin"], IdList[DropdownResponderId]["params"], IdList[DropdownResponderId]["workers"]>;
282
282
  get(id: ODValidId): ODDropdownResponder<"dropdown", any> | null;
283
- remove<DropdownResponderId extends keyof ODNoGeneric<IdList>>(id: DropdownResponderId): ODDropdownResponder<IdList[DropdownResponderId]["source"], IdList[DropdownResponderId]["params"], IdList[DropdownResponderId]["workers"]>;
283
+ remove<DropdownResponderId extends keyof ODNoGeneric<IdList>>(id: DropdownResponderId): ODDropdownResponder<IdList[DropdownResponderId]["origin"], IdList[DropdownResponderId]["params"], IdList[DropdownResponderId]["workers"]>;
284
284
  remove(id: ODValidId): ODDropdownResponder<"dropdown", any> | null;
285
285
  exists(id: keyof ODNoGeneric<IdList>): boolean;
286
286
  exists(id: ODValidId): boolean;
@@ -350,15 +350,15 @@ export declare class ODDropdownResponderInstance {
350
350
  *
351
351
  * This class manages all workers which are executed when the related dropdown is triggered.
352
352
  */
353
- export declare class ODDropdownResponder<Source extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODDropdownResponderInstance, Source, Params, WorkerIds> {
353
+ export declare class ODDropdownResponder<Origin extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODDropdownResponderInstance, Origin, Params, WorkerIds> {
354
354
  /**Respond to this dropdown */
355
- respond(instance: ODDropdownResponderInstance, source: Source, params: Params): Promise<void>;
355
+ respond(instance: ODDropdownResponderInstance, origin: Origin, params: Params): Promise<void>;
356
356
  }
357
357
  /**## ODModalResponderManagerIdConstraint `type`
358
358
  * The constraint/layout for id mappings/interfaces of the `ODModalResponderManager` class.
359
359
  */
360
360
  export type ODModalResponderManagerIdConstraint = Record<string, {
361
- source: "modal";
361
+ origin: "modal";
362
362
  params: object;
363
363
  workers: string;
364
364
  }>;
@@ -381,9 +381,9 @@ export declare class ODModalResponderManager<IdList extends ODModalResponderMana
381
381
  /**Set the message to send when the response times out! */
382
382
  setTimeoutErrorCallback(callback: ODResponderTimeoutErrorCallback<ODModalResponderInstance, "modal"> | null, ms: number | null): void;
383
383
  add(data: ODModalResponder<"modal", any>, overwrite?: boolean): boolean;
384
- get<ModalResponderId extends keyof ODNoGeneric<IdList>>(id: ModalResponderId): ODModalResponder<IdList[ModalResponderId]["source"], IdList[ModalResponderId]["params"], IdList[ModalResponderId]["workers"]>;
384
+ get<ModalResponderId extends keyof ODNoGeneric<IdList>>(id: ModalResponderId): ODModalResponder<IdList[ModalResponderId]["origin"], IdList[ModalResponderId]["params"], IdList[ModalResponderId]["workers"]>;
385
385
  get(id: ODValidId): ODModalResponder<"modal", any> | null;
386
- remove<ModalResponderId extends keyof ODNoGeneric<IdList>>(id: ModalResponderId): ODModalResponder<IdList[ModalResponderId]["source"], IdList[ModalResponderId]["params"], IdList[ModalResponderId]["workers"]>;
386
+ remove<ModalResponderId extends keyof ODNoGeneric<IdList>>(id: ModalResponderId): ODModalResponder<IdList[ModalResponderId]["origin"], IdList[ModalResponderId]["params"], IdList[ModalResponderId]["workers"]>;
387
387
  remove(id: ODValidId): ODModalResponder<"modal", any> | null;
388
388
  exists(id: keyof ODNoGeneric<IdList>): boolean;
389
389
  exists(id: ODValidId): boolean;
@@ -433,15 +433,15 @@ export declare class ODModalResponderInstance {
433
433
  *
434
434
  * This class manages all workers which are executed when the related modal is triggered.
435
435
  */
436
- export declare class ODModalResponder<Source extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODModalResponderInstance, Source, Params, WorkerIds> {
436
+ export declare class ODModalResponder<Origin extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODModalResponderInstance, Origin, Params, WorkerIds> {
437
437
  /**Respond to this modal */
438
- respond(instance: ODModalResponderInstance, source: Source, params: Params): Promise<void>;
438
+ respond(instance: ODModalResponderInstance, origin: Origin, params: Params): Promise<void>;
439
439
  }
440
440
  /**## ODContextMenuResponderManagerIdConstraint `type`
441
441
  * The constraint/layout for id mappings/interfaces of the `ODContextMenuResponderManager` class.
442
442
  */
443
443
  export type ODContextMenuResponderManagerIdConstraint = Record<string, {
444
- source: "context-menu";
444
+ origin: "context-menu";
445
445
  params: object;
446
446
  workers: string;
447
447
  }>;
@@ -464,9 +464,9 @@ export declare class ODContextMenuResponderManager<IdList extends ODContextMenuR
464
464
  /**Set the message to send when the response times out! */
465
465
  setTimeoutErrorCallback(callback: ODResponderTimeoutErrorCallback<ODContextMenuResponderInstance, "context-menu"> | null, ms: number | null): void;
466
466
  add(data: ODContextMenuResponder<"context-menu", any>, overwrite?: boolean): boolean;
467
- get<ModalResponderId extends keyof ODNoGeneric<IdList>>(id: ModalResponderId): ODContextMenuResponder<IdList[ModalResponderId]["source"], IdList[ModalResponderId]["params"], IdList[ModalResponderId]["workers"]>;
467
+ get<ModalResponderId extends keyof ODNoGeneric<IdList>>(id: ModalResponderId): ODContextMenuResponder<IdList[ModalResponderId]["origin"], IdList[ModalResponderId]["params"], IdList[ModalResponderId]["workers"]>;
468
468
  get(id: ODValidId): ODContextMenuResponder<"context-menu", any> | null;
469
- remove<ModalResponderId extends keyof ODNoGeneric<IdList>>(id: ModalResponderId): ODContextMenuResponder<IdList[ModalResponderId]["source"], IdList[ModalResponderId]["params"], IdList[ModalResponderId]["workers"]>;
469
+ remove<ModalResponderId extends keyof ODNoGeneric<IdList>>(id: ModalResponderId): ODContextMenuResponder<IdList[ModalResponderId]["origin"], IdList[ModalResponderId]["params"], IdList[ModalResponderId]["workers"]>;
470
470
  remove(id: ODValidId): ODContextMenuResponder<"context-menu", any> | null;
471
471
  exists(id: keyof ODNoGeneric<IdList>): boolean;
472
472
  exists(id: ODValidId): boolean;
@@ -508,15 +508,15 @@ export declare class ODContextMenuResponderInstance {
508
508
  *
509
509
  * This class manages all workers which are executed when the related context menu is triggered.
510
510
  */
511
- export declare class ODContextMenuResponder<Source extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODContextMenuResponderInstance, Source, Params, WorkerIds> {
511
+ export declare class ODContextMenuResponder<Origin extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODContextMenuResponderInstance, Origin, Params, WorkerIds> {
512
512
  /**Respond to this button */
513
- respond(instance: ODContextMenuResponderInstance, source: Source, params: Params): Promise<void>;
513
+ respond(instance: ODContextMenuResponderInstance, origin: Origin, params: Params): Promise<void>;
514
514
  }
515
515
  /**## ODAutocompleteResponderManagerIdConstraint `type`
516
516
  * The constraint/layout for id mappings/interfaces of the `ODAutocompleteResponderManager` class.
517
517
  */
518
518
  export type ODAutocompleteResponderManagerIdConstraint = Record<string, {
519
- source: "autocomplete";
519
+ origin: "autocomplete";
520
520
  params: object;
521
521
  workers: string;
522
522
  }>;
@@ -539,9 +539,9 @@ export declare class ODAutocompleteResponderManager<IdList extends ODAutocomplet
539
539
  /**Set the message to send when the response times out! */
540
540
  setTimeoutErrorCallback(callback: ODResponderTimeoutErrorCallback<ODAutocompleteResponderInstance, "autocomplete"> | null, ms: number | null): void;
541
541
  add(data: ODAutocompleteResponder<"autocomplete", any>, overwrite?: boolean): boolean;
542
- get<AutocompleteResponderId extends keyof ODNoGeneric<IdList>>(id: AutocompleteResponderId): ODAutocompleteResponder<IdList[AutocompleteResponderId]["source"], IdList[AutocompleteResponderId]["params"], IdList[AutocompleteResponderId]["workers"]>;
542
+ get<AutocompleteResponderId extends keyof ODNoGeneric<IdList>>(id: AutocompleteResponderId): ODAutocompleteResponder<IdList[AutocompleteResponderId]["origin"], IdList[AutocompleteResponderId]["params"], IdList[AutocompleteResponderId]["workers"]>;
543
543
  get(id: ODValidId): ODAutocompleteResponder<"autocomplete", any> | null;
544
- remove<AutocompleteResponderId extends keyof ODNoGeneric<IdList>>(id: AutocompleteResponderId): ODAutocompleteResponder<IdList[AutocompleteResponderId]["source"], IdList[AutocompleteResponderId]["params"], IdList[AutocompleteResponderId]["workers"]>;
544
+ remove<AutocompleteResponderId extends keyof ODNoGeneric<IdList>>(id: AutocompleteResponderId): ODAutocompleteResponder<IdList[AutocompleteResponderId]["origin"], IdList[AutocompleteResponderId]["params"], IdList[AutocompleteResponderId]["workers"]>;
545
545
  remove(id: ODValidId): ODAutocompleteResponder<"autocomplete", any> | null;
546
546
  exists(id: keyof ODNoGeneric<IdList>): boolean;
547
547
  exists(id: ODValidId): boolean;
@@ -581,10 +581,10 @@ export declare class ODAutocompleteResponderInstance {
581
581
  *
582
582
  * This class manages all workers which are executed when the related autocomplete is triggered.
583
583
  */
584
- export declare class ODAutocompleteResponder<Source extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODAutocompleteResponderInstance, Source, Params, WorkerIds> {
584
+ export declare class ODAutocompleteResponder<Origin extends string, Params, WorkerIds extends string = string> extends ODResponderImplementation<ODAutocompleteResponderInstance, Origin, Params, WorkerIds> {
585
585
  /**The slash command of the autocomplete should match the following regex. */
586
586
  cmdMatch: string | RegExp;
587
- constructor(id: ODValidId, cmdMatch: string | RegExp, match: string | RegExp, callback?: ODWorkerCallback<ODAutocompleteResponderInstance, Source, Params>, priority?: number, callbackId?: ODValidId);
587
+ constructor(id: ODValidId, cmdMatch: string | RegExp, match: string | RegExp, callback?: ODWorkerCallback<ODAutocompleteResponderInstance, Origin, Params>, priority?: number, callbackId?: ODValidId);
588
588
  /**Respond to this autocomplete interaction. */
589
- respond(instance: ODAutocompleteResponderInstance, source: Source, params: Params): Promise<void>;
589
+ respond(instance: ODAutocompleteResponderInstance, origin: Origin, params: Params): Promise<void>;
590
590
  }