dfx 0.107.4 → 0.108.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/DiscordGateway/DiscordWS.js +2 -2
- package/DiscordGateway/Sharder.d.ts +1 -1
- package/Interactions/definitions.d.ts +5 -5
- package/mjs/DiscordGateway/DiscordWS.mjs +2 -2
- package/mjs/version.mjs +1 -1
- package/package.json +3 -3
- package/src/DiscordGateway/DiscordWS.ts +2 -2
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -46,7 +46,7 @@ const make = /*#__PURE__*/Effect.gen(function* () {
|
|
|
46
46
|
});
|
|
47
47
|
const write = message => {
|
|
48
48
|
if (message === Reconnect) {
|
|
49
|
-
return Effect.catchAllCause(writeRaw(new Socket.CloseEvent(
|
|
49
|
+
return Effect.catchAllCause(writeRaw(new Socket.CloseEvent(3000, "reconnecting")), logWriteError);
|
|
50
50
|
}
|
|
51
51
|
return Effect.catchAllCause(writeRaw(encoding.encode(message)), logWriteError);
|
|
52
52
|
};
|
|
@@ -55,7 +55,7 @@ const make = /*#__PURE__*/Effect.gen(function* () {
|
|
|
55
55
|
messages.unsafeOffer(message);
|
|
56
56
|
fiber.log([message], Cause.empty, logLevelTrace);
|
|
57
57
|
}))), Effect.retry({
|
|
58
|
-
while: e => e.reason === "Close" && e.code ===
|
|
58
|
+
while: e => e.reason === "Close" && e.code === 3000
|
|
59
59
|
}), Effect.catchAllCause(cause => Effect.logDebug("Got socket error, reconnecting", cause)), Effect.repeat(Schedule.exponential(500).pipe(Schedule.union(Schedule.spaced(10000)))), Effect.annotateLogs("channel", "inbound"), Effect.forkScoped, Effect.interruptible);
|
|
60
60
|
return {
|
|
61
61
|
take: messages.take,
|
|
@@ -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,
|
|
13
|
+
export declare const SharderLive: Layer.Layer<Sharder, never, ShardStore | DiscordConfig | import("dfx/RateLimit").RateLimitStore | import("./DiscordWS").DiscordWSCodec | import("./Shard/StateStore").ShardStateStore | import("@effect/platform/Socket").WebSocketConstructor | import("@effect/platform/HttpClient").HttpClient<import("@effect/platform/HttpClientError").HttpClientError, import("effect/Scope").Scope>>;
|
|
14
14
|
//# sourceMappingURL=Sharder.d.ts.map
|
|
@@ -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, DiscordInteraction | DiscordApplicationCommand | Scope>, 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, DiscordInteraction | DiscordApplicationCommand | Scope>, 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, DiscordInteraction | Scope | 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, DiscordInteraction | Scope | 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, DiscordInteraction | DiscordApplicationCommand | Scope | 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>;
|
|
@@ -38,7 +38,7 @@ const make = /*#__PURE__*/Effect.gen(function* () {
|
|
|
38
38
|
});
|
|
39
39
|
const write = message => {
|
|
40
40
|
if (message === Reconnect) {
|
|
41
|
-
return Effect.catchAllCause(writeRaw(new Socket.CloseEvent(
|
|
41
|
+
return Effect.catchAllCause(writeRaw(new Socket.CloseEvent(3000, "reconnecting")), logWriteError);
|
|
42
42
|
}
|
|
43
43
|
return Effect.catchAllCause(writeRaw(encoding.encode(message)), logWriteError);
|
|
44
44
|
};
|
|
@@ -47,7 +47,7 @@ const make = /*#__PURE__*/Effect.gen(function* () {
|
|
|
47
47
|
messages.unsafeOffer(message);
|
|
48
48
|
fiber.log([message], Cause.empty, logLevelTrace);
|
|
49
49
|
}))), Effect.retry({
|
|
50
|
-
while: e => e.reason === "Close" && e.code ===
|
|
50
|
+
while: e => e.reason === "Close" && e.code === 3000
|
|
51
51
|
}), Effect.catchAllCause(cause => Effect.logDebug("Got socket error, reconnecting", cause)), Effect.repeat(Schedule.exponential(500).pipe(Schedule.union(Schedule.spaced(10000)))), Effect.annotateLogs("channel", "inbound"), Effect.forkScoped, Effect.interruptible);
|
|
52
52
|
return {
|
|
53
53
|
take: messages.take,
|
package/mjs/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const LIB_VERSION = "0.
|
|
1
|
+
export const LIB_VERSION = "0.108.0";
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dfx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.108.0",
|
|
4
4
|
"description": "Effect-TS discord library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"sideEffects": [],
|
|
36
36
|
"author": "Tim Smart <hello@timsmart.co>",
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@effect/platform": "^0.
|
|
38
|
+
"@effect/platform": "^0.71",
|
|
39
39
|
"effect": "^3.11"
|
|
40
40
|
},
|
|
41
41
|
"optionalDependencies": {
|
|
42
42
|
"discord-verify": "^1.2.0"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "cd1e95fa8c01ace20f42c79dd8c418c6d396bfdd",
|
|
45
45
|
"main": "./index.js"
|
|
46
46
|
}
|
|
@@ -73,7 +73,7 @@ const make = Effect.gen(function* () {
|
|
|
73
73
|
): Effect.Effect<void> => {
|
|
74
74
|
if (message === Reconnect) {
|
|
75
75
|
return Effect.catchAllCause(
|
|
76
|
-
writeRaw(new Socket.CloseEvent(
|
|
76
|
+
writeRaw(new Socket.CloseEvent(3000, "reconnecting")),
|
|
77
77
|
logWriteError,
|
|
78
78
|
)
|
|
79
79
|
}
|
|
@@ -93,7 +93,7 @@ const make = Effect.gen(function* () {
|
|
|
93
93
|
),
|
|
94
94
|
),
|
|
95
95
|
Effect.retry({
|
|
96
|
-
while: e => e.reason === "Close" && e.code ===
|
|
96
|
+
while: e => e.reason === "Close" && e.code === 3000,
|
|
97
97
|
}),
|
|
98
98
|
Effect.catchAllCause(cause =>
|
|
99
99
|
Effect.logDebug("Got socket error, reconnecting", cause),
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "0.
|
|
1
|
+
export const LIB_VERSION = "0.108.0";
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "0.
|
|
1
|
+
export declare const LIB_VERSION = "0.108.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED