dfx 0.95.2 → 0.96.0
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/Cache.d.ts +1 -1
- package/DiscordGateway/Shard/StateStore.d.ts +7 -5
- package/DiscordGateway/Shard/StateStore.d.ts.map +1 -1
- package/DiscordGateway/Shard/StateStore.js +36 -20
- package/DiscordGateway/Shard/StateStore.js.map +1 -1
- package/DiscordGateway/Shard.d.ts +2 -2
- package/DiscordGateway/Sharder.d.ts +1 -1
- package/DiscordGateway.d.ts +1 -1
- package/DiscordREST.d.ts +2 -2
- package/Interactions/context.d.ts +1 -1
- package/Interactions/definitions.d.ts +5 -5
- package/Interactions/gateway.d.ts +1 -1
- package/Interactions/webhook.d.ts +1 -1
- package/gateway.d.ts +2 -2
- package/gateway.js +1 -1
- package/gateway.js.map +1 -1
- package/mjs/DiscordGateway/Shard/StateStore.mjs +34 -19
- package/mjs/DiscordGateway/Shard/StateStore.mjs.map +1 -1
- package/mjs/gateway.mjs +2 -2
- package/mjs/gateway.mjs.map +1 -1
- package/mjs/types.mjs +7 -0
- package/mjs/types.mjs.map +1 -1
- package/mjs/version.mjs +1 -1
- package/package.json +3 -3
- package/src/DiscordGateway/Shard/StateStore.ts +45 -24
- package/src/gateway.ts +2 -2
- package/src/types.ts +21 -5
- package/src/version.ts +1 -1
- package/types.d.ts +21 -5
- package/types.d.ts.map +1 -1
- package/types.js +8 -1
- package/types.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/webhooks.d.ts +1 -1
package/Cache.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export declare const make: <EOps, EDriver, EMiss, A>({ driver, id, onMiss, ops,
|
|
|
73
73
|
onMiss: (id: string) => Effect.Effect<A, EMiss>;
|
|
74
74
|
}) => Effect.Effect<Cache<EDriver, EMiss, A>, never, Scope.Scope>;
|
|
75
75
|
export declare const CacheErrorTypeId: unique symbol;
|
|
76
|
-
declare const CacheMissError_base: new <A extends Record<string, any>>(args: Simplify<
|
|
76
|
+
declare const CacheMissError_base: new <A extends Record<string, any>>(args: import("effect/Types").Simplify<A>) => import("effect/Cause").YieldableError & Record<typeof CacheErrorTypeId, typeof CacheErrorTypeId> & {
|
|
77
77
|
readonly _tag: "CacheMissError";
|
|
78
78
|
} & Readonly<A>;
|
|
79
79
|
export declare class CacheMissError extends CacheMissError_base<{
|
|
@@ -2,24 +2,26 @@ import * as Effect from "effect/Effect";
|
|
|
2
2
|
import * as Option from "effect/Option";
|
|
3
3
|
import * as Context from "effect/Context";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
|
+
import * as KVS from "@effect/platform/KeyValueStore";
|
|
5
6
|
export interface ShardState {
|
|
6
7
|
readonly resumeUrl: string;
|
|
7
8
|
readonly sequence: number | null;
|
|
8
9
|
readonly sessionId: string;
|
|
9
10
|
}
|
|
10
|
-
export interface ShardStateStore {
|
|
11
|
-
readonly _: unique symbol;
|
|
12
|
-
}
|
|
13
11
|
export interface StateStore {
|
|
14
12
|
readonly get: Effect.Effect<Option.Option<ShardState>>;
|
|
15
13
|
readonly set: (state: ShardState) => Effect.Effect<void>;
|
|
16
14
|
readonly clear: Effect.Effect<void>;
|
|
17
15
|
}
|
|
18
|
-
|
|
16
|
+
declare const ShardStateStore_base: Context.TagClass<ShardStateStore, "dfx/Shard/StateStore", {
|
|
19
17
|
readonly forShard: (id: [
|
|
20
18
|
id: number,
|
|
21
19
|
count: number
|
|
22
20
|
]) => StateStore;
|
|
23
21
|
}>;
|
|
24
|
-
export declare
|
|
22
|
+
export declare class ShardStateStore extends ShardStateStore_base {
|
|
23
|
+
static MemoryLive: Layer.Layer<ShardStateStore>;
|
|
24
|
+
static KVSLive: Layer.Layer<ShardStateStore, never, KVS.KeyValueStore>;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
25
27
|
//# sourceMappingURL=StateStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateStore.d.ts","sourceRoot":"","sources":["../../src/DiscordGateway/Shard/StateStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"StateStore.d.ts","sourceRoot":"","sources":["../../src/DiscordGateway/Shard/StateStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,gCAAgC,CAAA;AAErD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAA;IACtD,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACxD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;CACpC;;uBAIsB,CAAC,EAAE,EAAE;QAAC,EAAE,EAAE,MAAM;QAAE,KAAK,EAAE,MAAM;KAAC,KAAK,UAAU;;AAFtE,qBAAa,eAAgB,SAAQ,oBAGlC;IACD,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAsB9C;IAED,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,EAAE,GAAG,CAAC,aAAa,CAAC,CAmBnE;CACJ"}
|
|
@@ -3,31 +3,47 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ShardStateStore =
|
|
6
|
+
exports.ShardStateStore = void 0;
|
|
7
7
|
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect"));
|
|
8
8
|
var Option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Option"));
|
|
9
9
|
var Context = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Context"));
|
|
10
10
|
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Layer"));
|
|
11
|
+
var KVS = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/KeyValueStore"));
|
|
11
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
14
|
+
class ShardStateStore extends Context.Tag("dfx/Shard/StateStore")() {
|
|
15
|
+
static MemoryLive = Layer.sync(ShardStateStore, () => {
|
|
16
|
+
const store = new Map();
|
|
17
|
+
return ShardStateStore.of({
|
|
18
|
+
forShard: ([id, count]) => {
|
|
19
|
+
const key = `${id}-${count}`;
|
|
20
|
+
return {
|
|
21
|
+
get: Effect.sync(() => Option.fromNullable(store.get(key))),
|
|
22
|
+
set(state) {
|
|
23
|
+
return Effect.sync(() => {
|
|
24
|
+
store.set(key, state);
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
clear: Effect.sync(() => {
|
|
28
|
+
store.delete(key);
|
|
29
|
+
})
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
31
33
|
});
|
|
32
|
-
|
|
34
|
+
static KVSLive = Layer.effect(ShardStateStore, Effect.gen(function* (_) {
|
|
35
|
+
const store = yield* KVS.KeyValueStore;
|
|
36
|
+
return ShardStateStore.of({
|
|
37
|
+
forShard([id, count]) {
|
|
38
|
+
const key = `dfx-shard-state-${id}-${count}`;
|
|
39
|
+
return {
|
|
40
|
+
get: Effect.map(Effect.orDie(store.get(key)), Option.map(JSON.parse)),
|
|
41
|
+
set: state => Effect.orDie(store.set(key, JSON.stringify(state))),
|
|
42
|
+
clear: Effect.orDie(store.remove(key))
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
exports.ShardStateStore = ShardStateStore;
|
|
33
49
|
//# sourceMappingURL=StateStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateStore.js","names":["Effect","_interopRequireWildcard","require","Option","Context","Layer","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ShardStateStore","
|
|
1
|
+
{"version":3,"file":"StateStore.js","names":["Effect","_interopRequireWildcard","require","Option","Context","Layer","KVS","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ShardStateStore","Tag","MemoryLive","sync","store","Map","of","forShard","id","count","key","fromNullable","state","clear","delete","KVSLive","effect","gen","_","KeyValueStore","map","orDie","JSON","parse","stringify","remove"],"sources":["../../src/DiscordGateway/Shard/StateStore.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,MAAA,gBAAAC,uBAAA,eAAAC,OAAA;AACA,IAAAC,MAAA,gBAAAF,uBAAA,eAAAC,OAAA;AACA,IAAAE,OAAA,gBAAAH,uBAAA,eAAAC,OAAA;AACA,IAAAG,KAAA,gBAAAJ,uBAAA,eAAAC,OAAA;AACA,IAAAI,GAAA,gBAAAL,uBAAA,eAAAC,OAAA;AAAqD,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,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AC,CACF;EAED,OAAOK,OAAO,GACZrC,KAAK,CAACsC,MAAM,CACVhB,eAAe,EACf3B,MAAM,CAAC4C,GAAG,CAAC,WAAWC,CAAC;IACrB,MAAMd,KAAK,GAAG,OAAOzB,GAAG,CAACwC,aAAa;IACtC,OAAOnB,eAAe,CAACM,EAAE,CAAC;MACxBC,QAAQA,CAAC,CAACC,EAAE,EAAEC,KAAK,CAAC;QAClB,MAAMC,GAAG,GAAG,mBAAmBF,EAAE,IAAIC,KAAK,EAAE;QAC5C,OAAO;UACLrB,GAAG,EAAEf,MAAM,CAAC+C,GAAG,CACb/C,MAAM,CAACgD,KAAK,CAACjB,KAAK,CAAChB,GAAG,CAACsB,GAAG,CAAC,CAAC,EAC5BlC,MAAM,CAAC4C,GAAG,CAACE,IAAI,CAACC,KAAK,CAAC,CACvB;UACDxB,GAAG,EAAEa,KAAK,IAAIvC,MAAM,CAACgD,KAAK,CAACjB,KAAK,CAACL,GAAG,CAACW,GAAG,EAAEY,IAAI,CAACE,SAAS,CAACZ,KAAK,CAAC,CAAC,CAAC;UACjEC,KAAK,EAAExC,MAAM,CAACgD,KAAK,CAACjB,KAAK,CAACqB,MAAM,CAACf,GAAG,CAAC;SACtC;MACH;KACD,CAAC;EACJ,CAAC,CAAC,CACH","ignoreList":[]}
|
|
@@ -10,7 +10,7 @@ export declare const make: Effect.Effect<{
|
|
|
10
10
|
readonly id: [id: number, count: number];
|
|
11
11
|
readonly send: (p: Message) => Effect.Effect<boolean, never, never>;
|
|
12
12
|
}, never, import("effect/Scope").Scope>;
|
|
13
|
-
}, never, DiscordConfig | RateLimiter |
|
|
13
|
+
}, never, DiscordConfig | RateLimiter | DiscordWS | import("dfx/DiscordGateway/Messaging").Messsaging | ShardStateStore>;
|
|
14
14
|
type ShardService = Effect.Effect.Success<typeof make>;
|
|
15
15
|
export interface Shard {
|
|
16
16
|
readonly _: unique symbol;
|
|
@@ -21,7 +21,7 @@ export declare const Shard: import("effect/Context").Tag<Shard, {
|
|
|
21
21
|
readonly send: (p: Message) => Effect.Effect<boolean, never, never>;
|
|
22
22
|
}, never, import("effect/Scope").Scope>;
|
|
23
23
|
}>;
|
|
24
|
-
export declare const ShardLive: Layer.Layer<Shard, never, DiscordConfig | import("dfx/RateLimit").RateLimitStore |
|
|
24
|
+
export declare const ShardLive: Layer.Layer<Shard, never, DiscordConfig | import("dfx/RateLimit").RateLimitStore | import("dfx/DiscordGateway/DiscordWS").DiscordWSCodec | ShardStateStore>;
|
|
25
25
|
export interface RunningShard extends Effect.Effect.Success<ReturnType<ShardService["connect"]>> {
|
|
26
26
|
}
|
|
27
27
|
export {};
|
|
@@ -10,5 +10,5 @@ export interface Sharder {
|
|
|
10
10
|
export declare const Sharder: import("effect/Context").Tag<Sharder, {
|
|
11
11
|
readonly shards: Effect.Effect<HashSet.HashSet<RunningShard>, never, never>;
|
|
12
12
|
}>;
|
|
13
|
-
export declare const SharderLive: Layer.Layer<Sharder, never, DiscordConfig | import("
|
|
13
|
+
export declare const SharderLive: Layer.Layer<Sharder, never, DiscordConfig | import("dfx/RateLimit").RateLimitStore | import("./DiscordWS").DiscordWSCodec | import("./Shard/StateStore").ShardStateStore | ShardStore | import("@effect/platform/Http/Client").Client.Default>;
|
|
14
14
|
//# sourceMappingURL=Sharder.d.ts.map
|
package/DiscordGateway.d.ts
CHANGED
|
@@ -17,5 +17,5 @@ export interface DiscordGateway {
|
|
|
17
17
|
}
|
|
18
18
|
export declare const DiscordGateway: import("effect/Context").Tag<DiscordGateway, DiscordGateway>;
|
|
19
19
|
export declare const make: Effect.Effect<DiscordGateway, never, import("dfx/DiscordGateway/Messaging").Messsaging | Sharder>;
|
|
20
|
-
export declare const DiscordGatewayLive: Layer.Layer<DiscordGateway, never, import("./DiscordConfig").DiscordConfig | import("
|
|
20
|
+
export declare const DiscordGatewayLive: Layer.Layer<DiscordGateway, never, import("./DiscordConfig").DiscordConfig | import("./RateLimit").RateLimitStore | import("./DiscordGateway/DiscordWS").DiscordWSCodec | import("./DiscordGateway/Shard/StateStore").ShardStateStore | import("./DiscordGateway/ShardStore").ShardStore | import("@effect/platform/Http/Client").Client.Default>;
|
|
21
21
|
//# sourceMappingURL=DiscordGateway.d.ts.map
|
package/DiscordREST.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import * as Effect from "effect/Effect";
|
|
|
7
7
|
import * as Layer from "effect/Layer";
|
|
8
8
|
import type { Scope } from "effect/Scope";
|
|
9
9
|
export declare const DiscordRESTErrorTypeId: unique symbol;
|
|
10
|
-
declare const DiscordRESTError_base: new <A extends Record<string, any>>(args: Simplify<
|
|
10
|
+
declare const DiscordRESTError_base: new <A extends Record<string, any>>(args: import("effect/Types").Simplify<A>) => import("effect/Cause").YieldableError & Record<typeof DiscordRESTErrorTypeId, typeof DiscordRESTErrorTypeId> & {
|
|
11
11
|
readonly _tag: "DiscordRESTError";
|
|
12
12
|
} & Readonly<A>;
|
|
13
13
|
export declare class DiscordRESTError extends DiscordRESTError_base<{
|
|
@@ -23,6 +23,6 @@ export interface DiscordRESTService extends Discord.Endpoints<Partial<Http.reque
|
|
|
23
23
|
readonly executor: <A = unknown>(request: Http.request.ClientRequest) => Effect.Effect<ResponseWithData<A>, DiscordRESTError, Scope>;
|
|
24
24
|
}
|
|
25
25
|
export declare const DiscordREST: import("effect/Context").Tag<DiscordREST, DiscordRESTService>;
|
|
26
|
-
export declare const DiscordRESTLive: Layer.Layer<DiscordREST, never, DiscordConfig | Http.client.Client.Default
|
|
26
|
+
export declare const DiscordRESTLive: Layer.Layer<DiscordREST, never, DiscordConfig | RateLimitStore | Http.client.Client.Default>;
|
|
27
27
|
export {};
|
|
28
28
|
//# sourceMappingURL=DiscordREST.d.ts.map
|
|
@@ -34,7 +34,7 @@ export declare const SubCommandContext: import("effect/Context").Tag<DiscordSubC
|
|
|
34
34
|
export declare const resolvedValues: <A>(f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) => Effect.Effect<ReadonlyArray<A>, NoSuchElementException, DiscordInteraction>;
|
|
35
35
|
export declare const resolved: <A>(name: string, f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) => Effect.Effect<A, NoSuchElementException, DiscordInteraction>;
|
|
36
36
|
export declare const focusedOptionValue: Effect.Effect<string, never, DiscordFocusedOption>;
|
|
37
|
-
declare const SubCommandNotFound_base: new <A extends Record<string, any>>(args: Simplify<
|
|
37
|
+
declare const SubCommandNotFound_base: new <A extends Record<string, any>>(args: import("effect/Types").Simplify<A>) => import("effect/Cause").YieldableError & Record<typeof InteractionsErrorTypeId, typeof InteractionsErrorTypeId> & {
|
|
38
38
|
readonly _tag: "SubCommandNotFound";
|
|
39
39
|
} & Readonly<A>;
|
|
40
40
|
export declare class SubCommandNotFound extends SubCommandNotFound_base<{
|
|
@@ -11,35 +11,35 @@ export declare class GlobalApplicationCommand<R, E> {
|
|
|
11
11
|
readonly _tag = "GlobalApplicationCommand";
|
|
12
12
|
constructor(command: Discord.CreateGlobalApplicationCommandParams, handle: CommandHandler<R, E>);
|
|
13
13
|
}
|
|
14
|
-
export declare const global: <R, E, const A extends Discord.CreateGlobalApplicationCommandParams>(command: A, handle: CommandHandler<R, E, A>) => GlobalApplicationCommand<Exclude<R,
|
|
14
|
+
export declare const global: <R, E, const A extends Discord.CreateGlobalApplicationCommandParams>(command: A, handle: CommandHandler<R, E, A>) => GlobalApplicationCommand<Exclude<R, Scope | DiscordInteraction | DiscordApplicationCommand>, E>;
|
|
15
15
|
export declare class GuildApplicationCommand<R, E> {
|
|
16
16
|
readonly command: Discord.CreateGuildApplicationCommandParams;
|
|
17
17
|
readonly handle: CommandHandler<R, E>;
|
|
18
18
|
readonly _tag = "GuildApplicationCommand";
|
|
19
19
|
constructor(command: Discord.CreateGuildApplicationCommandParams, handle: CommandHandler<R, E>);
|
|
20
20
|
}
|
|
21
|
-
export declare const guild: <R, E, const A extends Discord.CreateGuildApplicationCommandParams>(command: A, handle: CommandHandler<R, E, A>) => GuildApplicationCommand<Exclude<R,
|
|
21
|
+
export declare const guild: <R, E, const A extends Discord.CreateGuildApplicationCommandParams>(command: A, handle: CommandHandler<R, E, A>) => GuildApplicationCommand<Exclude<R, Scope | DiscordInteraction | DiscordApplicationCommand>, E>;
|
|
22
22
|
export declare class MessageComponent<R, E> {
|
|
23
23
|
readonly predicate: (customId: string) => boolean;
|
|
24
24
|
readonly handle: Effect.Effect<Discord.InteractionResponse, E, R>;
|
|
25
25
|
readonly _tag = "MessageComponent";
|
|
26
26
|
constructor(predicate: (customId: string) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>);
|
|
27
27
|
}
|
|
28
|
-
export declare const messageComponent: <R, E>(pred: (customId: string) => boolean, handle: CommandHandler<R, E, Discord.InteractionResponse>) => MessageComponent<Exclude<R,
|
|
28
|
+
export declare const messageComponent: <R, E>(pred: (customId: string) => boolean, handle: CommandHandler<R, E, Discord.InteractionResponse>) => MessageComponent<Exclude<R, Scope | DiscordInteraction | DiscordMessageComponent>, E>;
|
|
29
29
|
export declare class ModalSubmit<R, E> {
|
|
30
30
|
readonly predicate: (customId: string) => boolean;
|
|
31
31
|
readonly handle: Effect.Effect<Discord.InteractionResponse, E, R>;
|
|
32
32
|
readonly _tag = "ModalSubmit";
|
|
33
33
|
constructor(predicate: (customId: string) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>);
|
|
34
34
|
}
|
|
35
|
-
export declare const modalSubmit: <R, E>(pred: (customId: string) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>) => ModalSubmit<Exclude<R,
|
|
35
|
+
export declare const modalSubmit: <R, E>(pred: (customId: string) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>) => ModalSubmit<Exclude<R, Scope | DiscordInteraction | DiscordModalSubmit>, E>;
|
|
36
36
|
export declare class Autocomplete<R, E> {
|
|
37
37
|
readonly predicate: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => boolean;
|
|
38
38
|
readonly handle: Effect.Effect<Discord.InteractionResponse, E, R>;
|
|
39
39
|
readonly _tag = "Autocomplete";
|
|
40
40
|
constructor(predicate: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>);
|
|
41
41
|
}
|
|
42
|
-
export declare const autocomplete: <R, E>(pred: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>) => Autocomplete<Exclude<R,
|
|
42
|
+
export declare const autocomplete: <R, E>(pred: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>) => Autocomplete<Exclude<R, Scope | DiscordInteraction | DiscordApplicationCommand | DiscordFocusedOption>, E>;
|
|
43
43
|
export type CommandHandler<R, E, A = any> = Effect.Effect<Discord.InteractionResponse, E, R> | CommandHandlerFn<R, E, A>;
|
|
44
44
|
export interface CommandHelper<A> {
|
|
45
45
|
resolve: <T>(name: AllResolvables<A>["name"], f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => T | undefined) => Effect.Effect<T, NoSuchElementException, DiscordInteraction>;
|
|
@@ -17,5 +17,5 @@ export interface InteractionsRegistry {
|
|
|
17
17
|
readonly _: unique symbol;
|
|
18
18
|
}
|
|
19
19
|
export declare const InteractionsRegistry: import("effect/Context").Tag<InteractionsRegistry, InteractionsRegistryService>;
|
|
20
|
-
export declare const InteractionsRegistryLive: Layer.Layer<InteractionsRegistry, never,
|
|
20
|
+
export declare const InteractionsRegistryLive: Layer.Layer<InteractionsRegistry, never, DiscordGateway | DiscordREST>;
|
|
21
21
|
//# sourceMappingURL=gateway.d.ts.map
|
|
@@ -45,7 +45,7 @@ export declare const WebhookConfig: import("effect/Context").Tag<WebhookConfig,
|
|
|
45
45
|
}>;
|
|
46
46
|
export declare const layer: (opts: MakeConfigOpts) => Layer.Layer<WebhookConfig, never, never>;
|
|
47
47
|
export declare const layerConfig: (config: Config.Config<MakeConfigOpts>) => Layer.Layer<WebhookConfig, ConfigError.ConfigError>;
|
|
48
|
-
declare const WebhookParseError_base: new <A extends Record<string, any>>(args: Simplify<
|
|
48
|
+
declare const WebhookParseError_base: new <A extends Record<string, any>>(args: import("effect/Types").Simplify<A & {
|
|
49
49
|
readonly error: unknown;
|
|
50
50
|
}>) => Cause.YieldableError & Record<typeof InteractionsErrorTypeId, typeof InteractionsErrorTypeId> & {
|
|
51
51
|
readonly _tag: "WebhookParseError";
|
package/gateway.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ import * as Layer from "effect/Layer";
|
|
|
7
7
|
export { DiscordGateway, DiscordGatewayLive } from "dfx/DiscordGateway";
|
|
8
8
|
export { InteractionsRegistry, InteractionsRegistryLive, interactionsSync, run as runIx, setInteractionsSync, } from "dfx/Interactions/gateway";
|
|
9
9
|
export { CachePrelude, DiscordWS, SendEvent, Shard, ShardStore };
|
|
10
|
-
export declare const DiscordLive: Layer.Layer<import("dfx/RateLimit").RateLimiter | import("dfx/
|
|
11
|
-
export declare const DiscordIxLive: Layer.Layer<import("dfx/RateLimit").RateLimiter | import("dfx/
|
|
10
|
+
export declare const DiscordLive: Layer.Layer<import("dfx/RateLimit").RateLimiter | import("dfx/DiscordGateway").DiscordGateway | import("dfx/DiscordREST").DiscordREST, never, import("./DiscordConfig").DiscordConfig | import("@effect/platform/Http/Client").Client.Default>;
|
|
11
|
+
export declare const DiscordIxLive: Layer.Layer<import("dfx/RateLimit").RateLimiter | import("dfx/DiscordGateway").DiscordGateway | import("dfx/DiscordREST").DiscordREST | import("dfx/Interactions/gateway").InteractionsRegistry, never, import("./DiscordConfig").DiscordConfig | import("@effect/platform/Http/Client").Client.Default>;
|
|
12
12
|
//# sourceMappingURL=gateway.d.ts.map
|
package/gateway.js
CHANGED
|
@@ -68,6 +68,6 @@ var _RateLimit = /*#__PURE__*/require("dfx/RateLimit");
|
|
|
68
68
|
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Layer"));
|
|
69
69
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
70
70
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
71
|
-
const DiscordLive = exports.DiscordLive = /*#__PURE__*/Layer.mergeAll(_RateLimit.RateLimiterLive, _DiscordGateway.DiscordGatewayLive).pipe( /*#__PURE__*/Layer.provideMerge(_DiscordREST.DiscordRESTLive), /*#__PURE__*/Layer.provide(_DiscordWS.JsonDiscordWSCodecLive), /*#__PURE__*/Layer.provide(_RateLimit.MemoryRateLimitStoreLive), /*#__PURE__*/Layer.provide(_ShardStore.MemoryShardStoreLive), /*#__PURE__*/Layer.provide(_StateStore.
|
|
71
|
+
const DiscordLive = exports.DiscordLive = /*#__PURE__*/Layer.mergeAll(_RateLimit.RateLimiterLive, _DiscordGateway.DiscordGatewayLive).pipe( /*#__PURE__*/Layer.provideMerge(_DiscordREST.DiscordRESTLive), /*#__PURE__*/Layer.provide(_DiscordWS.JsonDiscordWSCodecLive), /*#__PURE__*/Layer.provide(_RateLimit.MemoryRateLimitStoreLive), /*#__PURE__*/Layer.provide(_ShardStore.MemoryShardStoreLive), /*#__PURE__*/Layer.provide(_StateStore.ShardStateStore.MemoryLive));
|
|
72
72
|
const DiscordIxLive = exports.DiscordIxLive = /*#__PURE__*/_gateway.InteractionsRegistryLive.pipe( /*#__PURE__*/Layer.provideMerge(DiscordLive));
|
|
73
73
|
//# sourceMappingURL=gateway.js.map
|
package/gateway.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.js","names":["CachePrelude","_interopRequireWildcard","require","exports","_DiscordGateway","_DiscordWS","DiscordWS","Shard","_StateStore","SendEvent","_ShardStore","ShardStore","_DiscordREST","_gateway","_RateLimit","Layer","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DiscordLive","mergeAll","RateLimiterLive","DiscordGatewayLive","pipe","provideMerge","DiscordRESTLive","provide","JsonDiscordWSCodecLive","MemoryRateLimitStoreLive","MemoryShardStoreLive","
|
|
1
|
+
{"version":3,"file":"gateway.js","names":["CachePrelude","_interopRequireWildcard","require","exports","_DiscordGateway","_DiscordWS","DiscordWS","Shard","_StateStore","SendEvent","_ShardStore","ShardStore","_DiscordREST","_gateway","_RateLimit","Layer","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DiscordLive","mergeAll","RateLimiterLive","DiscordGatewayLive","pipe","provideMerge","DiscordRESTLive","provide","JsonDiscordWSCodecLive","MemoryRateLimitStoreLive","MemoryShardStoreLive","ShardStateStore","MemoryLive","DiscordIxLive","InteractionsRegistryLive"],"sources":["./src/gateway.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,gBAAAC,uBAAA,eAAAC,OAAA;AAAiDC,OAAA,CAAAH,YAAA,GAAAA,YAAA;AACjD,IAAAI,eAAA,gBAAAF,OAAA;AACA,IAAAG,UAAA,gBAAAJ,uBAAA,eAAAC,OAAA;AAAyD,IAAAI,SAAA,GAAAD,UAAA;AAAAF,OAAA,CAAAG,SAAA,GAAA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A,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAc9B,MAAMW,WAAW,GAAAjC,OAAA,CAAAiC,WAAA,gBAAGrB,KAAK,CAACsB,QAAQ,CACvCC,0BAAe,EACfC,kCAAkB,CACnB,CAACC,IAAI,eACJzB,KAAK,CAAC0B,YAAY,CAACC,4BAAe,CAAC,eACnC3B,KAAK,CAAC4B,OAAO,CAACC,iCAAsB,CAAC,eACrC7B,KAAK,CAAC4B,OAAO,CAACE,mCAAwB,CAAC,eACvC9B,KAAK,CAAC4B,OAAO,CAACG,gCAAoB,CAAC,eACnC/B,KAAK,CAAC4B,OAAO,CAACI,2BAAe,CAACC,UAAU,CAAC,CAC1C;AAEM,MAAMC,aAAa,GAAA9C,OAAA,CAAA8C,aAAA,gBAAGC,iCAAwB,CAACV,IAAI,eACxDzB,KAAK,CAAC0B,YAAY,CAACL,WAAW,CAAC,CAChC","ignoreList":[]}
|
|
@@ -2,24 +2,39 @@ import * as Effect from "effect/Effect";
|
|
|
2
2
|
import * as Option from "effect/Option";
|
|
3
3
|
import * as Context from "effect/Context";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
import * as KVS from "@effect/platform/KeyValueStore";
|
|
6
|
+
export class ShardStateStore extends Context.Tag("dfx/Shard/StateStore")() {
|
|
7
|
+
static MemoryLive = Layer.sync(ShardStateStore, () => {
|
|
8
|
+
const store = new Map();
|
|
9
|
+
return ShardStateStore.of({
|
|
10
|
+
forShard: ([id, count]) => {
|
|
11
|
+
const key = `${id}-${count}`;
|
|
12
|
+
return {
|
|
13
|
+
get: Effect.sync(() => Option.fromNullable(store.get(key))),
|
|
14
|
+
set(state) {
|
|
15
|
+
return Effect.sync(() => {
|
|
16
|
+
store.set(key, state);
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
clear: Effect.sync(() => {
|
|
20
|
+
store.delete(key);
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
});
|
|
23
25
|
});
|
|
24
|
-
|
|
26
|
+
static KVSLive = Layer.effect(ShardStateStore, Effect.gen(function* (_) {
|
|
27
|
+
const store = yield* KVS.KeyValueStore;
|
|
28
|
+
return ShardStateStore.of({
|
|
29
|
+
forShard([id, count]) {
|
|
30
|
+
const key = `dfx-shard-state-${id}-${count}`;
|
|
31
|
+
return {
|
|
32
|
+
get: Effect.map(Effect.orDie(store.get(key)), Option.map(JSON.parse)),
|
|
33
|
+
set: state => Effect.orDie(store.set(key, JSON.stringify(state))),
|
|
34
|
+
clear: Effect.orDie(store.remove(key))
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
25
40
|
//# sourceMappingURL=StateStore.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateStore.mjs","names":["Effect","Option","Context","Layer","ShardStateStore","
|
|
1
|
+
{"version":3,"file":"StateStore.mjs","names":["Effect","Option","Context","Layer","KVS","ShardStateStore","Tag","MemoryLive","sync","store","Map","of","forShard","id","count","key","get","fromNullable","set","state","clear","delete","KVSLive","effect","gen","_","KeyValueStore","map","orDie","JSON","parse","stringify","remove"],"sources":["../../../src/DiscordGateway/Shard/StateStore.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,GAAG,MAAM,gCAAgC;AAcrD,OAAM,MAAOC,eAAgB,SAAQH,OAAO,CAACI,GAAG,CAAC,sBAAsB,CAAC,EAGrE;EACD,OAAOC,UAAU,GAAiCJ,KAAK,CAACK,IAAI,CAC1DH,eAAe,EACf,MAAK;IACH,MAAMI,KAAK,GAAG,IAAIC,GAAG,EAAsB;IAE3C,OAAOL,eAAe,CAACM,EAAE,CAAC;MACxBC,QAAQ,EAAEA,CAAC,CAACC,EAAE,EAAEC,KAAK,CAAC,KAAI;QACxB,MAAMC,GAAG,GAAG,GAAGF,EAAE,IAAIC,KAAK,EAAE;QAC5B,OAAO;UACLE,GAAG,EAAEhB,MAAM,CAACQ,IAAI,CAAC,MAAMP,MAAM,CAACgB,YAAY,CAACR,KAAK,CAACO,GAAG,CAACD,GAAG,CAAC,CAAC,CAAC;UAC3DG,GAAGA,CAACC,KAAK;YACP,OAAOnB,MAAM,CAACQ,IAAI,CAAC,MAAK;cACtBC,KAAK,CAACS,GAAG,CAACH,GAAG,EAAEI,KAAK,CAAC;YACvB,CAAC,CAAC;UACJ,CAAC;UACDC,KAAK,EAAEpB,MAAM,CAACQ,IAAI,CAAC,MAAK;YACtBC,KAAK,CAACY,MAAM,CAACN,GAAG,CAAC;UACnB,CAAC;SACF;MACH;KACD,CAAC;EACJ,CAAC,CACF;EAED,OAAOO,OAAO,GACZnB,KAAK,CAACoB,MAAM,CACVlB,eAAe,EACfL,MAAM,CAACwB,GAAG,CAAC,WAAWC,CAAC;IACrB,MAAMhB,KAAK,GAAG,OAAOL,GAAG,CAACsB,aAAa;IACtC,OAAOrB,eAAe,CAACM,EAAE,CAAC;MACxBC,QAAQA,CAAC,CAACC,EAAE,EAAEC,KAAK,CAAC;QAClB,MAAMC,GAAG,GAAG,mBAAmBF,EAAE,IAAIC,KAAK,EAAE;QAC5C,OAAO;UACLE,GAAG,EAAEhB,MAAM,CAAC2B,GAAG,CACb3B,MAAM,CAAC4B,KAAK,CAACnB,KAAK,CAACO,GAAG,CAACD,GAAG,CAAC,CAAC,EAC5Bd,MAAM,CAAC0B,GAAG,CAACE,IAAI,CAACC,KAAK,CAAC,CACvB;UACDZ,GAAG,EAAEC,KAAK,IAAInB,MAAM,CAAC4B,KAAK,CAACnB,KAAK,CAACS,GAAG,CAACH,GAAG,EAAEc,IAAI,CAACE,SAAS,CAACZ,KAAK,CAAC,CAAC,CAAC;UACjEC,KAAK,EAAEpB,MAAM,CAAC4B,KAAK,CAACnB,KAAK,CAACuB,MAAM,CAACjB,GAAG,CAAC;SACtC;MACH;KACD,CAAC;EACJ,CAAC,CAAC,CACH","ignoreList":[]}
|
package/mjs/gateway.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { DiscordGatewayLive } from "dfx/DiscordGateway";
|
|
|
3
3
|
import * as DiscordWS from "dfx/DiscordGateway/DiscordWS";
|
|
4
4
|
import { JsonDiscordWSCodecLive } from "dfx/DiscordGateway/DiscordWS";
|
|
5
5
|
import * as Shard from "dfx/DiscordGateway/Shard";
|
|
6
|
-
import {
|
|
6
|
+
import { ShardStateStore } from "dfx/DiscordGateway/Shard/StateStore";
|
|
7
7
|
import * as SendEvent from "dfx/DiscordGateway/Shard/sendEvents";
|
|
8
8
|
import * as ShardStore from "dfx/DiscordGateway/ShardStore";
|
|
9
9
|
import { MemoryShardStoreLive } from "dfx/DiscordGateway/ShardStore";
|
|
@@ -14,6 +14,6 @@ import * as Layer from "effect/Layer";
|
|
|
14
14
|
export { DiscordGateway, DiscordGatewayLive } from "dfx/DiscordGateway";
|
|
15
15
|
export { InteractionsRegistry, InteractionsRegistryLive, interactionsSync, run as runIx, setInteractionsSync } from "dfx/Interactions/gateway";
|
|
16
16
|
export { CachePrelude, DiscordWS, SendEvent, Shard, ShardStore };
|
|
17
|
-
export const DiscordLive = /*#__PURE__*/Layer.mergeAll(RateLimiterLive, DiscordGatewayLive).pipe( /*#__PURE__*/Layer.provideMerge(DiscordRESTLive), /*#__PURE__*/Layer.provide(JsonDiscordWSCodecLive), /*#__PURE__*/Layer.provide(MemoryRateLimitStoreLive), /*#__PURE__*/Layer.provide(MemoryShardStoreLive), /*#__PURE__*/Layer.provide(
|
|
17
|
+
export const DiscordLive = /*#__PURE__*/Layer.mergeAll(RateLimiterLive, DiscordGatewayLive).pipe( /*#__PURE__*/Layer.provideMerge(DiscordRESTLive), /*#__PURE__*/Layer.provide(JsonDiscordWSCodecLive), /*#__PURE__*/Layer.provide(MemoryRateLimitStoreLive), /*#__PURE__*/Layer.provide(MemoryShardStoreLive), /*#__PURE__*/Layer.provide(ShardStateStore.MemoryLive));
|
|
18
18
|
export const DiscordIxLive = /*#__PURE__*/InteractionsRegistryLive.pipe( /*#__PURE__*/Layer.provideMerge(DiscordLive));
|
|
19
19
|
//# sourceMappingURL=gateway.mjs.map
|
package/mjs/gateway.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.mjs","names":["CachePrelude","DiscordGatewayLive","DiscordWS","JsonDiscordWSCodecLive","Shard","
|
|
1
|
+
{"version":3,"file":"gateway.mjs","names":["CachePrelude","DiscordGatewayLive","DiscordWS","JsonDiscordWSCodecLive","Shard","ShardStateStore","SendEvent","ShardStore","MemoryShardStoreLive","DiscordRESTLive","InteractionsRegistryLive","MemoryRateLimitStoreLive","RateLimiterLive","Layer","DiscordGateway","InteractionsRegistry","interactionsSync","run","runIx","setInteractionsSync","DiscordLive","mergeAll","pipe","provideMerge","provide","MemoryLive","DiscordIxLive"],"sources":["../src/gateway.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,YAAY,MAAM,mBAAmB;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message is a voice message */
|
|
1634
1634
|
IS_VOICE_MESSAGE: 1 << 13
|
|
1635
1635
|
};
|
|
1636
|
+
export var MessageReferenceType;
|
|
1637
|
+
(function (MessageReferenceType) {
|
|
1638
|
+
/** A standard reference used by replies. */
|
|
1639
|
+
MessageReferenceType[MessageReferenceType["DEFAULT"] = 0] = "DEFAULT";
|
|
1640
|
+
/** Reference used to point to a message at a point in time. */
|
|
1641
|
+
MessageReferenceType[MessageReferenceType["FORWARD"] = 1] = "FORWARD";
|
|
1642
|
+
})(MessageReferenceType || (MessageReferenceType = {}));
|
|
1636
1643
|
export var MessageType;
|
|
1637
1644
|
(function (MessageType) {
|
|
1638
1645
|
MessageType[MessageType["DEFAULT"] = 0] = "DEFAULT";
|