dfx 0.15.1 → 0.15.3
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/Shard/heartbeats.d.ts +1 -2
- package/DiscordGateway/Shard/identify.d.ts +1 -2
- package/DiscordGateway/Shard/invalidSession.d.ts +1 -2
- package/DiscordGateway/Shard/utils.d.ts +2 -3
- package/DiscordGateway/ShardStore/index.d.ts +1 -1
- package/DiscordGateway/Sharder/index.d.ts +1 -2
- package/DiscordREST/utils.d.ts +3 -3
- package/Helpers/interactions.d.ts +11 -12
- package/Interactions/context.d.ts +6 -4
- package/Interactions/context.js +4 -2
- package/Interactions/context.js.map +1 -1
- package/Interactions/definitions.d.ts +60 -11
- package/Interactions/definitions.js +2 -0
- package/Interactions/definitions.js.map +1 -1
- package/Interactions/handlers.js +13 -1
- package/Interactions/handlers.js.map +1 -1
- package/RateLimitStore/index.d.ts +1 -1
- package/global.d.ts +1 -2
- package/index.d.ts +1 -0
- package/package.json +3 -2
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Ref } from "@effect/io/Ref";
|
|
2
|
-
import { Maybe } from "
|
|
2
|
+
import { Maybe, Discord } from "dfx";
|
|
3
3
|
import { Effect } from "@effect/io/Effect";
|
|
4
4
|
import { DiscordWS } from "dfx/gateway";
|
|
5
5
|
import { EffectSource } from "callbag-effect-ts/Source";
|
|
6
|
-
import { Discord } from "dfx";
|
|
7
6
|
export declare const fromRaw: <R, E>(source: import("callbag-effect-ts/Source").EffectSource<R, E, import("../../types.js").GatewayPayload<any>>, seqRef: Ref<Maybe<number>>) => import("callbag-effect-ts/Source").EffectSource<R, E, import("../DiscordWS/index.js").Message>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EffectSource } from "callbag-effect-ts/Source";
|
|
2
|
-
import { Discord } from "dfx";
|
|
2
|
+
import { Discord, Maybe } from "dfx";
|
|
3
3
|
import { Ref } from "@effect/io/Ref";
|
|
4
|
-
import { Maybe } from "@fp-ts/data/Option";
|
|
5
4
|
import { DiscordWS } from "dfx/gateway";
|
|
6
5
|
export declare const fromRaw: <R, E>(raw: import("callbag-effect-ts/Source").EffectSource<R, E, import("../../types.js").GatewayPayload<any>>, latestReady: Ref<Maybe<Discord.ReadyEvent>>) => import("callbag-effect-ts/Source").EffectSource<R, E, import("../DiscordWS/index.js").Message>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EffectSource } from "callbag-effect-ts/Source";
|
|
2
|
-
import { Discord } from "dfx";
|
|
3
|
-
import { Maybe } from "@fp-ts/data/Option";
|
|
2
|
+
import { Discord, Maybe } from "dfx";
|
|
4
3
|
import { Ref } from "@effect/io/Ref";
|
|
5
4
|
export declare const opCode: <R, E>(source: import("callbag-effect-ts/Source").EffectSource<R, E, import("../../types.js").GatewayPayload<any>>) => <T = any>(code: Discord.GatewayOpcode) => import("callbag-effect-ts/Source").EffectSource<R, E, import("../../types.js").GatewayPayload<T>>;
|
|
6
|
-
export declare const latest: <T>(f: (p: Discord.GatewayPayload) => import("../../
|
|
5
|
+
export declare const latest: <T>(f: (p: Discord.GatewayPayload) => import("../../index.js").Maybe<T>) => import("../../global.js").Effect<never, never, readonly [import("../../global.js").Ref<import("../../index.js").Maybe<T>>, (p: import("../../types.js").GatewayPayload<any>) => import("../../global.js").Effect<never, never, void>]>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Effect } from "@effect/io/Effect";
|
|
2
|
-
import { Maybe } from "
|
|
2
|
+
import { Maybe, Discord } from "dfx";
|
|
3
3
|
import { EffectSource } from "callbag-effect-ts/Source";
|
|
4
|
-
import { Discord } from "dfx";
|
|
5
4
|
import { ShardStore } from "../ShardStore/index.js";
|
|
6
5
|
export declare const spawn: import("callbag-effect-ts/Source").EffectSource<import("../../Log/index.js").Log | import("../DiscordWS/index.js").DiscordWSCodec | import("../../DiscordConfig/index.js").DiscordConfig | import("../../RateLimitStore/index.js").RateLimiter | ShardStore | import("../../index.js").DiscordREST, never, {
|
|
7
6
|
run: import("../../global.js").Effect<never, never, void>;
|
package/DiscordREST/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const routeFromConfig: (path: string, init: RequestInit) => string;
|
|
2
|
-
export declare const numberHeader: (headers: Headers) => (key: string) => import("../
|
|
3
|
-
export declare const retryAfter: (headers: Headers) => import("../
|
|
4
|
-
export declare const rateLimitFromHeaders: (headers: Headers) => import("../
|
|
2
|
+
export declare const numberHeader: (headers: Headers) => (key: string) => import("../index.js").Maybe<number>;
|
|
3
|
+
export declare const retryAfter: (headers: Headers) => import("../index.js").Maybe<import("../global.js").Duration>;
|
|
4
|
+
export declare const rateLimitFromHeaders: (headers: Headers) => import("../index.js").Maybe<{
|
|
5
5
|
readonly bucket: string;
|
|
6
6
|
readonly retryAfter: import("../global.js").Duration;
|
|
7
7
|
readonly limit: number;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Discord } from "dfx";
|
|
2
|
-
import { Maybe } from "@fp-ts/data/Option";
|
|
1
|
+
import { Discord, Maybe } from "dfx";
|
|
3
2
|
/**
|
|
4
3
|
* Maybe find a sub-command within the interaction options.
|
|
5
4
|
*/
|
|
@@ -7,7 +6,7 @@ export declare const allSubCommands: (interaction: Discord.ApplicationCommandDat
|
|
|
7
6
|
/**
|
|
8
7
|
* Maybe find a sub-command within the interaction options.
|
|
9
8
|
*/
|
|
10
|
-
export declare const findSubCommand: (name: string) => (interaction: Discord.ApplicationCommandDatum) => import("../
|
|
9
|
+
export declare const findSubCommand: (name: string) => (interaction: Discord.ApplicationCommandDatum) => import("../index.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>;
|
|
11
10
|
/**
|
|
12
11
|
* If the sub-command exists return `true`, else `false`.
|
|
13
12
|
*/
|
|
@@ -15,7 +14,7 @@ export declare const isSubCommand: (name: string) => (interaction: import("../ty
|
|
|
15
14
|
/**
|
|
16
15
|
* Maybe get the options for a sub-command
|
|
17
16
|
*/
|
|
18
|
-
export declare const subCommandOptions: (name: string) => (interaction: import("../types.js").ApplicationCommandDatum) => import("../
|
|
17
|
+
export declare const subCommandOptions: (name: string) => (interaction: import("../types.js").ApplicationCommandDatum) => import("../index.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption[]>;
|
|
19
18
|
/**
|
|
20
19
|
* A lens for accessing nested options in a interaction.
|
|
21
20
|
*/
|
|
@@ -31,27 +30,27 @@ export declare const optionsMap: (data: Pick<import("../types.js").ApplicationCo
|
|
|
31
30
|
/**
|
|
32
31
|
* Try find a matching option from the interaction.
|
|
33
32
|
*/
|
|
34
|
-
export declare const getOption: (name: string) => (data: Pick<import("../types.js").ApplicationCommandDatum, "options">) => import("../
|
|
33
|
+
export declare const getOption: (name: string) => (data: Pick<import("../types.js").ApplicationCommandDatum, "options">) => import("../index.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>;
|
|
35
34
|
/**
|
|
36
35
|
* Try find a matching option from the interaction.
|
|
37
36
|
*/
|
|
38
|
-
export declare const focusedOption: (data: Pick<import("../types.js").ApplicationCommandDatum, "options">) => import("../
|
|
37
|
+
export declare const focusedOption: (data: Pick<import("../types.js").ApplicationCommandDatum, "options">) => import("../index.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>;
|
|
39
38
|
/**
|
|
40
39
|
* Try find a matching option value from the interaction.
|
|
41
40
|
*/
|
|
42
|
-
export declare const optionValue: (name: string) => (data: Pick<import("../types.js").ApplicationCommandDatum, "options">) => import("../
|
|
41
|
+
export declare const optionValue: (name: string) => (data: Pick<import("../types.js").ApplicationCommandDatum, "options">) => import("../index.js").Maybe<string>;
|
|
43
42
|
/**
|
|
44
43
|
* Try extract resolved data
|
|
45
44
|
*/
|
|
46
|
-
export declare const resolved: (data: Discord.Interaction) => import("../
|
|
45
|
+
export declare const resolved: (data: Discord.Interaction) => import("../index.js").Maybe<import("../types.js").ResolvedDatum>;
|
|
47
46
|
/**
|
|
48
47
|
* Try find a matching option value from the interaction.
|
|
49
48
|
*/
|
|
50
|
-
export declare const resolveOptionValue: <T>(name: string, f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => T | undefined) => (a: Discord.Interaction) => import("../
|
|
49
|
+
export declare const resolveOptionValue: <T>(name: string, f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => T | undefined) => (a: Discord.Interaction) => import("../index.js").Maybe<T>;
|
|
51
50
|
/**
|
|
52
51
|
* Try find matching option values from the interaction.
|
|
53
52
|
*/
|
|
54
|
-
export declare const resolveValues: <T>(f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => T | undefined) => (a: Discord.Interaction) => import("../
|
|
53
|
+
export declare const resolveValues: <T>(f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => T | undefined) => (a: Discord.Interaction) => import("../index.js").Maybe<readonly T[]>;
|
|
55
54
|
/**
|
|
56
55
|
* A lens for accessing the components in a interaction.
|
|
57
56
|
*/
|
|
@@ -71,11 +70,11 @@ export declare const componentsMap: (a: import("../types.js").ModalSubmitDatum)
|
|
|
71
70
|
/**
|
|
72
71
|
* Try find a matching component from the interaction.
|
|
73
72
|
*/
|
|
74
|
-
export declare const getComponent: (id: string) => (a: import("../types.js").ModalSubmitDatum) => import("../
|
|
73
|
+
export declare const getComponent: (id: string) => (a: import("../types.js").ModalSubmitDatum) => import("../index.js").Maybe<import("../types.js").Component>;
|
|
75
74
|
/**
|
|
76
75
|
* Try find a matching component value from the interaction.
|
|
77
76
|
*/
|
|
78
|
-
export declare const componentValue: (id: string) => (a: import("../types.js").ModalSubmitDatum) => import("../
|
|
77
|
+
export declare const componentValue: (id: string) => (a: import("../types.js").ModalSubmitDatum) => import("../index.js").Maybe<string>;
|
|
79
78
|
export type InteractionResponse = {
|
|
80
79
|
type: Discord.InteractionCallbackType.CHANNEL_MESSAGE_WITH_SOURCE;
|
|
81
80
|
data: Discord.InteractionCallbackMessage;
|
|
@@ -44,9 +44,11 @@ export declare class RequiredOptionNotFound {
|
|
|
44
44
|
readonly _tag = "RequiredOptionNotFound";
|
|
45
45
|
constructor(data: Discord.ApplicationCommandDatum | Discord.ApplicationCommandInteractionDataOption, name: string);
|
|
46
46
|
}
|
|
47
|
-
export declare const findOption: (name: string) => Effect<import("../types.js").ApplicationCommandDatum, never, import("../
|
|
48
|
-
export declare const
|
|
47
|
+
export declare const findOption: (name: string) => Effect<import("../types.js").ApplicationCommandDatum, never, import("../index.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>>;
|
|
48
|
+
export declare const optionValue: (name: string) => Effect<import("../types.js").ApplicationCommandDatum, RequiredOptionNotFound, string>;
|
|
49
|
+
export declare const optionValueOptional: (name: string) => Effect<import("../types.js").ApplicationCommandDatum, never, import("../index.js").Maybe<string>>;
|
|
49
50
|
export declare const subCommandOptionsMap: Effect<SubCommandContext, never, Record<string, string | undefined>>;
|
|
50
|
-
export declare const findSubCommandOption: (name: string) => Effect<SubCommandContext, never, import("../
|
|
51
|
-
export declare const
|
|
51
|
+
export declare const findSubCommandOption: (name: string) => Effect<SubCommandContext, never, import("../index.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>>;
|
|
52
|
+
export declare const subCommandOptionValue: (name: string) => Effect<SubCommandContext, RequiredOptionNotFound, string>;
|
|
53
|
+
export declare const subCommandOptionValueOptional: (name: string) => Effect<SubCommandContext, RequiredOptionNotFound, string>;
|
|
52
54
|
export declare const modalValues: Effect<import("../types.js").ModalSubmitDatum, never, Record<string, string | undefined>>;
|
package/Interactions/context.js
CHANGED
|
@@ -44,9 +44,11 @@ export class RequiredOptionNotFound {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
export const findOption = (name) => tsplus_module_2.serviceWith(ApplicationCommandContext)(IxHelpers.getOption(name));
|
|
47
|
-
export const
|
|
47
|
+
export const optionValue = (name) => tsplus_module_2.flatMap((o) => tsplus_module_3.match(() => tsplus_module_2.flatMap((data) => tsplus_module_2.fail(new RequiredOptionNotFound(data, name)))(getCommand), tsplus_module_2.succeed)(tsplus_module_3.flatMapNullable((a) => a.value)(o)))(findOption(name));
|
|
48
|
+
export const optionValueOptional = (name) => tsplus_module_2.map((o) => tsplus_module_3.flatMapNullable((a) => a.value)(o))(findOption(name));
|
|
48
49
|
export const subCommandOptionsMap = tsplus_module_2.map(IxHelpers.optionsMap)(getSubCommand);
|
|
49
50
|
export const findSubCommandOption = (name) => tsplus_module_2.serviceWith(SubCommandContext)(({ command }) => IxHelpers.getOption(name)(command));
|
|
50
|
-
export const
|
|
51
|
+
export const subCommandOptionValue = (name) => tsplus_module_2.flatMap((o) => tsplus_module_3.match(() => tsplus_module_2.flatMap((data) => tsplus_module_2.fail(new RequiredOptionNotFound(data, name)))(getSubCommand), tsplus_module_2.succeed)(tsplus_module_3.flatMapNullable((a) => a.value)(o)))(findSubCommandOption(name));
|
|
52
|
+
export const subCommandOptionValueOptional = (name) => tsplus_module_2.flatMap((o) => tsplus_module_3.match(() => tsplus_module_2.flatMap((data) => tsplus_module_2.fail(new RequiredOptionNotFound(data, name)))(getSubCommand), tsplus_module_2.succeed)(tsplus_module_3.flatMapNullable((a) => a.value)(o)))(findSubCommandOption(name));
|
|
51
53
|
export const modalValues = tsplus_module_2.serviceWith(ModalSubmitContext)(IxHelpers.componentsMap);
|
|
52
54
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/Interactions/context.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAA;AAChD,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAA;AAEvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAA,GAAG,EAAuB,CAAA;AAC5D,MAAM,CAAC,MAAM,yBAAyB,GAAG,gBAAA,GAAG,EAAmC,CAAA;AAC/E,MAAM,CAAC,MAAM,uBAAuB,GAAG,gBAAA,GAAG,E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fx";
|
|
2
|
+
import { Effect, EffectTypeId } from "@effect/io/Effect";
|
|
3
|
+
import { RequiredOptionNotFound, ResolvedDataNotFound, SubCommandContext, SubCommandNotFound } from "./context.js";
|
|
4
|
+
import type { F } from "ts-toolbelt";
|
|
3
5
|
type DescriptionMissing<A> = A extends {
|
|
4
6
|
type: Exclude<Discord.ApplicationCommandType, 1>;
|
|
5
7
|
} ? false : A extends {
|
|
@@ -8,37 +10,84 @@ type DescriptionMissing<A> = A extends {
|
|
|
8
10
|
export type InteractionDefinition<R, E> = GlobalApplicationCommand<R, E> | GuildApplicationCommand<R, E> | MessageComponent<R, E> | ModalSubmit<R, E> | Autocomplete<R, E>;
|
|
9
11
|
export declare class GlobalApplicationCommand<R, E> {
|
|
10
12
|
readonly command: Discord.CreateGlobalApplicationCommandParams;
|
|
11
|
-
readonly handle:
|
|
13
|
+
readonly handle: CommandHandler<R, E>;
|
|
12
14
|
readonly _tag = "GlobalApplicationCommand";
|
|
13
|
-
constructor(command: Discord.CreateGlobalApplicationCommandParams, handle:
|
|
15
|
+
constructor(command: Discord.CreateGlobalApplicationCommandParams, handle: CommandHandler<R, E>);
|
|
14
16
|
}
|
|
15
|
-
export declare const global: <R, E, A extends import("../types.js").CreateGlobalApplicationCommandParams>(command: A
|
|
17
|
+
export declare const global: <R, E, A extends import("../types.js").CreateGlobalApplicationCommandParams>(command: F.Narrow<A>, handle: DescriptionMissing<A> extends true ? "command description is missing" : CommandHandler<R, E, A>) => GlobalApplicationCommand<Exclude<R, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum>, E>;
|
|
16
18
|
export declare class GuildApplicationCommand<R, E> {
|
|
17
19
|
readonly command: Discord.CreateGuildApplicationCommandParams;
|
|
18
|
-
readonly handle:
|
|
20
|
+
readonly handle: CommandHandler<R, E>;
|
|
19
21
|
readonly _tag = "GuildApplicationCommand";
|
|
20
|
-
constructor(command: Discord.CreateGuildApplicationCommandParams, handle:
|
|
22
|
+
constructor(command: Discord.CreateGuildApplicationCommandParams, handle: CommandHandler<R, E>);
|
|
21
23
|
}
|
|
22
|
-
export declare const guild: <R, E, A extends import("../types.js").CreateGuildApplicationCommandParams>(command: A, handle: DescriptionMissing<A> extends true ? "command description is missing" :
|
|
24
|
+
export declare const guild: <R, E, A extends import("../types.js").CreateGuildApplicationCommandParams>(command: A, handle: DescriptionMissing<A> extends true ? "command description is missing" : CommandHandler<R, E, A>) => GuildApplicationCommand<Exclude<R, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum>, E>;
|
|
23
25
|
export declare class MessageComponent<R, E> {
|
|
24
26
|
readonly predicate: (customId: string) => Effect<R, E, boolean>;
|
|
25
27
|
readonly handle: Effect<R, E, Discord.InteractionResponse>;
|
|
26
28
|
readonly _tag = "MessageComponent";
|
|
27
29
|
constructor(predicate: (customId: string) => Effect<R, E, boolean>, handle: Effect<R, E, Discord.InteractionResponse>);
|
|
28
30
|
}
|
|
29
|
-
export declare const messageComponent: <R1, R2, E1, E2>(pred: (customId: string) =>
|
|
31
|
+
export declare const messageComponent: <R1, R2, E1, E2>(pred: (customId: string) => Effect<R1, E1, boolean>, handle: CommandHandler<R2, E2, import("../types.js").InteractionResponse>) => MessageComponent<Exclude<R1, import("../types.js").Interaction | import("../types.js").MessageComponentDatum> | Exclude<R2, import("../types.js").Interaction | import("../types.js").MessageComponentDatum>, E1 | E2>;
|
|
30
32
|
export declare class ModalSubmit<R, E> {
|
|
31
33
|
readonly predicate: (customId: string) => Effect<R, E, boolean>;
|
|
32
34
|
readonly handle: Effect<R, E, Discord.InteractionResponse>;
|
|
33
35
|
readonly _tag = "ModalSubmit";
|
|
34
36
|
constructor(predicate: (customId: string) => Effect<R, E, boolean>, handle: Effect<R, E, Discord.InteractionResponse>);
|
|
35
37
|
}
|
|
36
|
-
export declare const modalSubmit: <R1, R2, E1, E2>(pred: (customId: string) =>
|
|
38
|
+
export declare const modalSubmit: <R1, R2, E1, E2>(pred: (customId: string) => Effect<R1, E1, boolean>, handle: Effect<R2, E2, import("../types.js").InteractionResponse>) => ModalSubmit<Exclude<R1, import("../types.js").Interaction | import("../types.js").ModalSubmitDatum> | Exclude<R2, import("../types.js").Interaction | import("../types.js").ModalSubmitDatum>, E1 | E2>;
|
|
37
39
|
export declare class Autocomplete<R, E> {
|
|
38
40
|
readonly predicate: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => Effect<R, E, boolean>;
|
|
39
41
|
readonly handle: Effect<R, E, Discord.InteractionResponse>;
|
|
40
42
|
readonly _tag = "Autocomplete";
|
|
41
43
|
constructor(predicate: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => Effect<R, E, boolean>, handle: Effect<R, E, Discord.InteractionResponse>);
|
|
42
44
|
}
|
|
43
|
-
export declare const autocomplete: <R1, R2, E1, E2>(pred: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) =>
|
|
45
|
+
export declare const autocomplete: <R1, R2, E1, E2>(pred: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => Effect<R1, E1, boolean>, handle: Effect<R2, E2, import("../types.js").InteractionResponse>) => Autocomplete<Exclude<R1, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum | import("../types.js").ApplicationCommandInteractionDataOption> | Exclude<R2, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum | import("../types.js").ApplicationCommandInteractionDataOption>, E1 | E2>;
|
|
46
|
+
type CommandHandler<R, E, A = any> = Effect<R, E, Discord.InteractionResponse> | CommandHandlerFn<R, E, A>;
|
|
47
|
+
export interface CommandHelper<A> {
|
|
48
|
+
resolve: <T>(name: Resolvables<A>["name"], f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => T | undefined) => Effect<Discord.Interaction, ResolvedDataNotFound, T>;
|
|
49
|
+
option: (name: CommandOptions<A>["name"]) => Effect<Discord.ApplicationCommandDatum, never, Maybe<Discord.ApplicationCommandInteractionDataOption>>;
|
|
50
|
+
optionValue: (name: RequiredCommandOptions<A>["name"]) => Effect<Discord.ApplicationCommandDatum, RequiredOptionNotFound, string>;
|
|
51
|
+
optionValueOptional: (name: CommandOptions<A>["name"]) => Effect<Discord.ApplicationCommandDatum, never, Maybe<string>>;
|
|
52
|
+
subCommandOption: (name: SubCommandOptions<A>["name"]) => Effect<SubCommandContext, never, Maybe<Discord.ApplicationCommandInteractionDataOption>>;
|
|
53
|
+
subCommandOptionValue: (name: RequiredSubCommandOptions<A>["name"]) => Effect<SubCommandContext, RequiredOptionNotFound, string>;
|
|
54
|
+
subCommandOptionValueOptional: (name: SubCommandOptions<A>["name"]) => Effect<SubCommandContext, never, Maybe<string>>;
|
|
55
|
+
subCommands: <NER extends SubCommands<A> extends never ? never : Record<SubCommands<A>["name"], Effect<any, any, Discord.InteractionResponse>>>(commands: NER) => Effect<Exclude<[
|
|
56
|
+
NER[keyof NER]
|
|
57
|
+
] extends [
|
|
58
|
+
{
|
|
59
|
+
[EffectTypeId]: {
|
|
60
|
+
_R: (_: never) => infer R;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
] ? R : never, SubCommandContext> | Discord.Interaction | Discord.ApplicationCommandDatum, ([NER[keyof NER]] extends [
|
|
64
|
+
{
|
|
65
|
+
[EffectTypeId]: {
|
|
66
|
+
_E: (_: never) => infer E;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
] ? E : never) | SubCommandNotFound, Discord.InteractionResponse>;
|
|
70
|
+
}
|
|
71
|
+
type CommandHandlerFn<R, E, A> = (i: CommandHelper<A>) => Effect<R, E, Discord.InteractionResponse>;
|
|
72
|
+
type ExtractOptions<A, T> = A extends {
|
|
73
|
+
type: T;
|
|
74
|
+
name: string;
|
|
75
|
+
options?: Discord.ApplicationCommandOption[];
|
|
76
|
+
} ? A : A extends {
|
|
77
|
+
options: Discord.ApplicationCommandOption[];
|
|
78
|
+
} ? ExtractOptions<A["options"][number], T> : never;
|
|
79
|
+
type RequiredOptions<A, T> = A extends {
|
|
80
|
+
options: Discord.ApplicationCommandOption[];
|
|
81
|
+
} ? Extract<A["options"][number], {
|
|
82
|
+
type: T;
|
|
83
|
+
required: true;
|
|
84
|
+
}> : never;
|
|
85
|
+
type CommandOptions<A> = ExtractOptions<A, Exclude<Discord.ApplicationCommandOptionType, Discord.ApplicationCommandOptionType.SUB_COMMAND | Discord.ApplicationCommandOptionType.SUB_COMMAND_GROUP>>;
|
|
86
|
+
type RequiredCommandOptions<A> = RequiredOptions<A, Exclude<Discord.ApplicationCommandOptionType, Discord.ApplicationCommandOptionType.SUB_COMMAND | Discord.ApplicationCommandOptionType.SUB_COMMAND_GROUP>>;
|
|
87
|
+
type SubCommands<A> = ExtractOptions<A, Discord.ApplicationCommandOptionType.SUB_COMMAND>;
|
|
88
|
+
type SubCommandOptions<A> = Exclude<SubCommands<A>["options"], undefined>[number];
|
|
89
|
+
type RequiredSubCommandOptions<A> = Extract<Exclude<SubCommands<A>["options"], undefined>[number], {
|
|
90
|
+
required: true;
|
|
91
|
+
}>;
|
|
92
|
+
type Resolvables<A> = ExtractOptions<A, Discord.ApplicationCommandOptionType.ROLE | Discord.ApplicationCommandOptionType.USER | Discord.ApplicationCommandOptionType.MENTIONABLE | Discord.ApplicationCommandOptionType.CHANNEL>;
|
|
44
93
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/Interactions/definitions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/Interactions/definitions.ts"],"names":[],"mappings":";AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAwBxD,MAAM,OAAO,wBAAwB;IAGxB;IACA;IAHF,IAAI,GAAG,0BAA0B,CAAA;IAC1C,YACW,OAAqD,EACrD,MAA4B;QAD5B,YAAO,GAAP,OAAO,CAA8C;QACrD,WAAM,GAAN,MAAM,CAAsB;IACpC,C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,CAA2C;IACzD,CAAC;CACL;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,IAG4B,EAC5B,MAAmD,EACnD,EAAE,CACF,IAAI,YAAY,CAQd,IAAW,EAAE,MAAa,CAAC,CAAA"}
|
package/Interactions/handlers.js
CHANGED
|
@@ -13,6 +13,16 @@ export class DefinitionNotFound {
|
|
|
13
13
|
this.interaction = interaction;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
const context = {
|
|
17
|
+
resolve: Ctx.getResolved,
|
|
18
|
+
option: Ctx.findOption,
|
|
19
|
+
optionValue: Ctx.optionValue,
|
|
20
|
+
optionValueOptional: Ctx.optionValueOptional,
|
|
21
|
+
subCommandOption: Ctx.findSubCommandOption,
|
|
22
|
+
subCommandOptionValue: Ctx.subCommandOptionValue,
|
|
23
|
+
subCommandOptionValueOptional: Ctx.subCommandOptionValueOptional,
|
|
24
|
+
subCommands: Ctx.handleSubCommands,
|
|
25
|
+
};
|
|
16
26
|
export const handlers = (definitions) => {
|
|
17
27
|
const { Commands, Autocomplete, MessageComponent, ModalSubmit } = splitDefinitions(definitions);
|
|
18
28
|
return {
|
|
@@ -21,7 +31,9 @@ export const handlers = (definitions) => {
|
|
|
21
31
|
}),
|
|
22
32
|
[tsplus_module_1.Discord.InteractionType.APPLICATION_COMMAND]: (i) => {
|
|
23
33
|
const data = i.data;
|
|
24
|
-
return tsplus_module_4.pipe(tsplus_module_3.match(() => tsplus_module_2.fail(new DefinitionNotFound(i)), (command) =>
|
|
34
|
+
return tsplus_module_4.pipe(tsplus_module_3.match(() => tsplus_module_2.fail(new DefinitionNotFound(i)), (command) => tsplus_module_2.isEffect(command.handle)
|
|
35
|
+
? command.handle
|
|
36
|
+
: command.handle(context))(tsplus_module_3.fromNullable(Commands[data.name])), (a) => a, tsplus_module_2.provideService(Ctx.ApplicationCommandContext)(data));
|
|
25
37
|
},
|
|
26
38
|
[tsplus_module_1.Discord.InteractionType.MODAL_SUBMIT]: (i) => {
|
|
27
39
|
const data = i.data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/Interactions/handlers.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AAEnC,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE7C,MAAM,OAAO,kBAAkB;IAER;IADZ,IAAI,GAAG,oBAAoB,CAAA;IACpC,YAAqB,WAAgC;QAAhC,gBAAW,GAAX,WAAW,CAAqB;IAAG,CAAC;CAC1D;AAQD,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,WAA4C,EAI5C,EAAE;IACF,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,GAC7D,gBAAgB,CAAC,WAAW,CAAC,CAAA;IAE/B,OAAO;QACL,CAAC,gBAAA,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CACnC,wBAAe;YACb,IAAI,EAAE,gBAAA,OAAO,CAAC,uBAAuB,CAAC,IAAI;SACpC,CAAC;QAEX,CAAC,gBAAA,OAAO,CAAC,eAAe,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;YACnD,MAAM,IAAI,GAAG,CAAC,CAAC,IAAuC,CAAA;YAEtD,OAAO,gBAAA,IAAI,CACT,sBACE,GAAG,EAAE,CAAC,qBAAY,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAAkB,EAC7D,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/Interactions/handlers.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AAEnC,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAA;AAChD,OAAO,EAAE,gBA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CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAD3B,CAAC,CAC2B,CAKzB,gCAPL,CAAC,EAQA,EACH,+BAAsB,GAAG,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,EAC1D,+BAAsB,GAAG,CAAC,oBAAoB,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CACnE,EAtBE,gBAAA,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAuBjC,CACuD,CAAA;QAC5D,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
|
package/global.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ import type { Equal } from "@fp-ts/data/Equal";
|
|
|
33
33
|
/**
|
|
34
34
|
* @tsplus global
|
|
35
35
|
*/
|
|
36
|
-
import type {
|
|
36
|
+
import type { Maybe } from "dfx";
|
|
37
37
|
/**
|
|
38
38
|
* @tsplus global
|
|
39
39
|
*/
|
|
@@ -86,5 +86,4 @@ export type { Effect } from "@effect/io/Effect";
|
|
|
86
86
|
export type { Layer } from "@effect/io/Layer";
|
|
87
87
|
export { Context, Tag } from "@fp-ts/data/Context";
|
|
88
88
|
export type { Duration } from "@fp-ts/data/Duration";
|
|
89
|
-
export type { Option as Maybe } from "@fp-ts/data/Option";
|
|
90
89
|
export type { Ref } from "@effect/io/Ref";
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dfx",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"@tim-smart/discord-api-docs-parser": "^0.4.1",
|
|
26
26
|
"@types/ws": "^8.5.3",
|
|
27
27
|
"lerna": "^6.1.0",
|
|
28
|
+
"ts-toolbelt": "^9.6.0",
|
|
28
29
|
"typescript": "https://cdn.jsdelivr.net/npm/@tsplus/installer/compiler/typescript.tgz"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
@@ -47,5 +48,5 @@
|
|
|
47
48
|
"@fp-ts/data": "^0.0.20"
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "c834316c54f806a80a87418f6c496dfc190df02d"
|
|
51
52
|
}
|