@saykit/carbon 0.8.0 → 0.9.1
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/dist/index.mjs +0 -21
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -22,14 +22,6 @@ function combineCommandOptions(mappedOptions, baseLocale) {
|
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/mixers/with-say.ts
|
|
24
24
|
const ClassMap = /* @__PURE__ */ new WeakMap();
|
|
25
|
-
/**
|
|
26
|
-
* Factory function that creates a "withSay" wrapper around a base class.
|
|
27
|
-
*
|
|
28
|
-
* @param Base The base class constructor.
|
|
29
|
-
* @returns A subclass of the given base class with extra for localisation.
|
|
30
|
-
* @throws If the base class is neither a {@link BaseCommand} nor a
|
|
31
|
-
* {@link BaseComponent}.
|
|
32
|
-
*/
|
|
33
25
|
function withSay(Base) {
|
|
34
26
|
if (ClassMap.has(Base)) return ClassMap.get(Base);
|
|
35
27
|
if (Base.prototype instanceof BaseCommand) {
|
|
@@ -101,19 +93,6 @@ function applyGuildExtension() {
|
|
|
101
93
|
}
|
|
102
94
|
//#endregion
|
|
103
95
|
//#region src/plugin.ts
|
|
104
|
-
/**
|
|
105
|
-
* A Carbon plugin that provides a singleton {@link Say} instance.
|
|
106
|
-
*
|
|
107
|
-
* `SayPlugin` registers a {@link Say} instance globally and
|
|
108
|
-
* applies interaction and guild-level extensions so that commands and
|
|
109
|
-
* other handlers can access localisation utilities directly.
|
|
110
|
-
*
|
|
111
|
-
* @example
|
|
112
|
-
* ```ts
|
|
113
|
-
* const say = new Say({ ... });
|
|
114
|
-
* const client = new Client({ ... }, { ... }, [new SayPlugin(say)]);
|
|
115
|
-
* ```
|
|
116
|
-
*/
|
|
117
96
|
var SayPlugin = class extends Plugin {
|
|
118
97
|
id = "saykit";
|
|
119
98
|
constructor(say) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saykit/carbon",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Carbon Discord framework integration for saykit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bot",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"!dist/**/*.map"
|
|
25
25
|
],
|
|
26
26
|
"type": "module",
|
|
27
|
+
"sideEffects": false,
|
|
27
28
|
"exports": {
|
|
28
29
|
".": {
|
|
29
30
|
"types": "./dist/index.d.mts",
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@buape/carbon": "0.16.0",
|
|
39
|
-
"saykit": "^0.
|
|
40
|
+
"saykit": "^0.9.1"
|
|
40
41
|
},
|
|
41
42
|
"peerDependencies": {
|
|
42
43
|
"@buape/carbon": "*",
|