dfx 0.20.4 → 0.21.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/driver.d.ts +16 -16
- package/Cache/driver.js.map +1 -1
- package/Cache/index.d.ts +21 -21
- package/Cache/index.js +12 -13
- package/Cache/index.js.map +1 -1
- package/Cache/memory.d.ts +3 -3
- package/Cache/memory.js +19 -20
- package/Cache/memory.js.map +1 -1
- package/Cache/memoryTTL.d.ts +5 -5
- package/Cache/memoryTTL.js +16 -16
- package/Cache/memoryTTL.js.map +1 -1
- package/Cache/prelude.d.ts +41 -41
- package/Cache/prelude.js +39 -41
- package/Cache/prelude.js.map +1 -1
- package/DiscordConfig/index.d.ts +4 -19
- package/DiscordConfig/index.js +5 -12
- package/DiscordConfig/index.js.map +1 -1
- package/DiscordGateway/DiscordWS/index.d.ts +9 -9
- package/DiscordGateway/DiscordWS/index.js +16 -20
- package/DiscordGateway/DiscordWS/index.js.map +1 -1
- package/DiscordGateway/Shard/heartbeats.d.ts +3 -4
- package/DiscordGateway/Shard/heartbeats.js +9 -16
- package/DiscordGateway/Shard/heartbeats.js.map +1 -1
- package/DiscordGateway/Shard/identify.d.ts +4 -4
- package/DiscordGateway/Shard/identify.js +5 -4
- package/DiscordGateway/Shard/identify.js.map +1 -1
- package/DiscordGateway/Shard/index.d.ts +8 -7
- package/DiscordGateway/Shard/index.js +17 -20
- package/DiscordGateway/Shard/index.js.map +1 -1
- package/DiscordGateway/Shard/invalidSession.d.ts +2 -3
- package/DiscordGateway/Shard/invalidSession.js +5 -8
- package/DiscordGateway/Shard/invalidSession.js.map +1 -1
- package/DiscordGateway/Shard/sendEvents.d.ts +1 -1
- package/DiscordGateway/Shard/sendEvents.js +7 -7
- package/DiscordGateway/Shard/sendEvents.js.map +1 -1
- package/DiscordGateway/Shard/utils.d.ts +3 -4
- package/DiscordGateway/Shard/utils.js +6 -6
- package/DiscordGateway/Shard/utils.js.map +1 -1
- package/DiscordGateway/ShardStore/index.d.ts +6 -6
- package/DiscordGateway/ShardStore/index.js +7 -10
- package/DiscordGateway/ShardStore/index.js.map +1 -1
- package/DiscordGateway/Sharder/index.d.ts +11 -11
- package/DiscordGateway/Sharder/index.js +21 -42
- package/DiscordGateway/Sharder/index.js.map +1 -1
- package/DiscordGateway/WS/index.d.ts +3 -2
- package/DiscordGateway/WS/index.js +30 -40
- package/DiscordGateway/WS/index.js.map +1 -1
- package/DiscordGateway/index.d.ts +8 -9
- package/DiscordGateway/index.js +10 -15
- package/DiscordGateway/index.js.map +1 -1
- package/DiscordREST/index.d.ts +132 -132
- package/DiscordREST/index.js +37 -40
- package/DiscordREST/index.js.map +1 -1
- package/DiscordREST/types.d.ts +6 -6
- package/DiscordREST/utils.d.ts +5 -4
- package/DiscordREST/utils.js +5 -5
- package/DiscordREST/utils.js.map +1 -1
- package/Helpers/intents.js +8 -8
- package/Helpers/intents.js.map +1 -1
- package/Helpers/interactions.d.ts +18 -19
- package/Helpers/interactions.js +22 -23
- package/Helpers/interactions.js.map +1 -1
- package/Helpers/members.d.ts +2 -2
- package/Helpers/members.js.map +1 -1
- package/Helpers/permissions.d.ts +4 -4
- package/Helpers/permissions.js +13 -13
- package/Helpers/permissions.js.map +1 -1
- package/Http/index.d.ts +10 -9
- package/Http/index.js +7 -8
- package/Http/index.js.map +1 -1
- package/Interactions/context.d.ts +22 -23
- package/Interactions/context.js +21 -21
- package/Interactions/context.js.map +1 -1
- package/Interactions/definitions.d.ts +31 -31
- package/Interactions/definitions.js +1 -2
- package/Interactions/definitions.js.map +1 -1
- package/Interactions/gateway.d.ts +4 -3
- package/Interactions/gateway.js +6 -6
- package/Interactions/gateway.js.map +1 -1
- package/Interactions/handlers.d.ts +3 -4
- package/Interactions/handlers.js +23 -23
- package/Interactions/handlers.js.map +1 -1
- package/Interactions/index.d.ts +11 -11
- package/Interactions/index.js +11 -10
- package/Interactions/index.js.map +1 -1
- package/Interactions/webhook.d.ts +7 -8
- package/Interactions/webhook.js +11 -12
- package/Interactions/webhook.js.map +1 -1
- package/Log/index.d.ts +8 -7
- package/Log/index.js +9 -11
- package/Log/index.js.map +1 -1
- package/README.md +48 -0
- package/RateLimit/index.d.ts +13 -12
- package/RateLimit/index.js +11 -12
- package/RateLimit/index.js.map +1 -1
- package/RateLimit/memory.d.ts +1 -1
- package/RateLimit/memory.js +7 -7
- package/RateLimit/memory.js.map +1 -1
- package/RateLimit/utils.d.ts +2 -2
- package/RateLimit/utils.js.map +1 -1
- package/_common.d.ts +19 -0
- package/_common.js +20 -0
- package/_common.js.map +1 -0
- package/gateway.d.ts +11 -10
- package/gateway.js +17 -14
- package/gateway.js.map +1 -1
- package/package.json +10 -16
- package/utils/effect.d.ts +8 -8
- package/utils/effect.js +4 -4
- package/utils/effect.js.map +1 -1
- package/webhooks.d.ts +6 -5
- package/webhooks.js +12 -8
- package/webhooks.js.map +1 -1
- package/global.d.ts +0 -21
- package/global.js +0 -2
- package/global.js.map +0 -1
- package/utils/common.d.ts +0 -18
- package/utils/common.js +0 -3
- package/utils/common.js.map +0 -1
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
import { Discord } from "dfx";
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const ModalSubmitContext: import("../utils/common.js").Tag<import("../types.js").ModalSubmitDatum>;
|
|
1
|
+
import { Context, Discord, Effect, HashMap } from "dfx/_common";
|
|
2
|
+
export declare const InteractionContext: Context.Tag<Discord.Interaction>;
|
|
3
|
+
export declare const ApplicationCommandContext: Context.Tag<Discord.ApplicationCommandDatum>;
|
|
4
|
+
export declare const MessageComponentContext: Context.Tag<Discord.MessageComponentDatum>;
|
|
5
|
+
export declare const ModalSubmitContext: Context.Tag<Discord.ModalSubmitDatum>;
|
|
7
6
|
export interface FocusedOptionContext {
|
|
8
7
|
readonly focusedOption: Discord.ApplicationCommandInteractionDataOption;
|
|
9
8
|
}
|
|
10
|
-
export declare const FocusedOptionContext:
|
|
9
|
+
export declare const FocusedOptionContext: Context.Tag<FocusedOptionContext>;
|
|
11
10
|
export interface SubCommandContext {
|
|
12
11
|
readonly command: Discord.ApplicationCommandInteractionDataOption;
|
|
13
12
|
}
|
|
14
|
-
export declare const SubCommandContext:
|
|
15
|
-
export declare const interaction: Effect<
|
|
16
|
-
export declare const command: Effect<
|
|
13
|
+
export declare const SubCommandContext: Context.Tag<SubCommandContext>;
|
|
14
|
+
export declare const interaction: Effect.Effect<Discord.Interaction, never, Discord.Interaction>;
|
|
15
|
+
export declare const command: Effect.Effect<Discord.ApplicationCommandDatum, never, Discord.ApplicationCommandDatum>;
|
|
17
16
|
export declare class ResolvedDataNotFound {
|
|
18
17
|
readonly data: Discord.Interaction;
|
|
19
18
|
readonly name?: string | undefined;
|
|
20
19
|
readonly _tag = "ResolvedDataNotFound";
|
|
21
20
|
constructor(data: Discord.Interaction, name?: string | undefined);
|
|
22
21
|
}
|
|
23
|
-
export declare const resolvedValues: <A>(f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) => Effect<
|
|
24
|
-
export declare const resolved: <A>(name: string, f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) => Effect<
|
|
25
|
-
export declare const focusedOptionValue: Effect<FocusedOptionContext, never, string>;
|
|
22
|
+
export declare const resolvedValues: <A>(f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) => Effect.Effect<Discord.Interaction, ResolvedDataNotFound, readonly A[]>;
|
|
23
|
+
export declare const resolved: <A>(name: string, f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) => Effect.Effect<Discord.Interaction, ResolvedDataNotFound, A>;
|
|
24
|
+
export declare const focusedOptionValue: Effect.Effect<FocusedOptionContext, never, string>;
|
|
26
25
|
export declare class SubCommandNotFound {
|
|
27
26
|
readonly data: Discord.ApplicationCommandDatum;
|
|
28
27
|
readonly _tag = "SubCommandNotFound";
|
|
29
28
|
constructor(data: Discord.ApplicationCommandDatum);
|
|
30
29
|
}
|
|
31
|
-
export declare const handleSubCommands: <NER extends Record<string, Effect<any, any,
|
|
32
|
-
[EffectTypeId]: {
|
|
30
|
+
export declare const handleSubCommands: <NER extends Record<string, Effect.Effect<any, any, Discord.InteractionResponse>>>(commands: NER) => Effect.Effect<Discord.Interaction | Discord.ApplicationCommandDatum | Exclude<[NER[keyof NER]] extends [{
|
|
31
|
+
[Effect.EffectTypeId]: {
|
|
33
32
|
_R: (_: never) => infer R;
|
|
34
33
|
};
|
|
35
34
|
}] ? R : never, SubCommandContext>, SubCommandNotFound | ([NER[keyof NER]] extends [{
|
|
36
|
-
[EffectTypeId]: {
|
|
35
|
+
[Effect.EffectTypeId]: {
|
|
37
36
|
_E: (_: never) => infer E;
|
|
38
37
|
};
|
|
39
|
-
}] ? E : never),
|
|
40
|
-
export declare const currentSubCommand: Effect<SubCommandContext, never,
|
|
41
|
-
export declare const optionsMap: Effect<
|
|
38
|
+
}] ? E : never), Discord.InteractionResponse>;
|
|
39
|
+
export declare const currentSubCommand: Effect.Effect<SubCommandContext, never, Discord.ApplicationCommandInteractionDataOption>;
|
|
40
|
+
export declare const optionsMap: Effect.Effect<Discord.ApplicationCommandDatum, never, HashMap.HashMap<string, string | undefined>>;
|
|
42
41
|
export declare class RequiredOptionNotFound {
|
|
43
42
|
readonly data: Discord.ApplicationCommandDatum | Discord.ApplicationCommandInteractionDataOption;
|
|
44
43
|
readonly name: string;
|
|
45
44
|
readonly _tag = "RequiredOptionNotFound";
|
|
46
45
|
constructor(data: Discord.ApplicationCommandDatum | Discord.ApplicationCommandInteractionDataOption, name: string);
|
|
47
46
|
}
|
|
48
|
-
export declare const option: (name: string) => Effect<
|
|
49
|
-
export declare const optionValue: (name: string) => Effect<
|
|
50
|
-
export declare const optionValueOptional: (name: string) => Effect<
|
|
51
|
-
export declare const modalValues: Effect<
|
|
47
|
+
export declare const option: (name: string) => Effect.Effect<Discord.ApplicationCommandDatum, never, import("../index.js").Maybe<Discord.ApplicationCommandInteractionDataOption>>;
|
|
48
|
+
export declare const optionValue: (name: string) => Effect.Effect<Discord.ApplicationCommandDatum, RequiredOptionNotFound, string>;
|
|
49
|
+
export declare const optionValueOptional: (name: string) => Effect.Effect<Discord.ApplicationCommandDatum, never, import("../index.js").Maybe<string>>;
|
|
50
|
+
export declare const modalValues: Effect.Effect<Discord.ModalSubmitDatum, never, HashMap.HashMap<string, string | undefined>>;
|
package/Interactions/context.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "
|
|
1
|
+
import * as tsplus_module_1 from "@fp-ts/data/Option";
|
|
2
2
|
import * as tsplus_module_2 from "@effect/io/Effect";
|
|
3
|
-
import * as tsplus_module_3 from "@fp-ts/data/Option";
|
|
4
|
-
import { EffectTypeId } from "@effect/io/Effect";
|
|
5
3
|
import * as Arr from "@fp-ts/data/ReadonlyArray";
|
|
4
|
+
import { Context, Effect, HashMap, pipe } from "dfx/_common";
|
|
6
5
|
import * as IxHelpers from "../Helpers/interactions.js";
|
|
7
|
-
export const InteractionContext =
|
|
8
|
-
export const ApplicationCommandContext =
|
|
9
|
-
export const MessageComponentContext =
|
|
10
|
-
export const ModalSubmitContext =
|
|
11
|
-
export const FocusedOptionContext =
|
|
12
|
-
export const SubCommandContext =
|
|
13
|
-
export const interaction =
|
|
14
|
-
export const command =
|
|
6
|
+
export const InteractionContext = Context.Tag();
|
|
7
|
+
export const ApplicationCommandContext = Context.Tag();
|
|
8
|
+
export const MessageComponentContext = Context.Tag();
|
|
9
|
+
export const ModalSubmitContext = Context.Tag();
|
|
10
|
+
export const FocusedOptionContext = Context.Tag();
|
|
11
|
+
export const SubCommandContext = Context.Tag();
|
|
12
|
+
export const interaction = Effect.service(InteractionContext);
|
|
13
|
+
export const command = Effect.service(ApplicationCommandContext);
|
|
15
14
|
export class ResolvedDataNotFound {
|
|
16
15
|
data;
|
|
17
16
|
name;
|
|
@@ -21,9 +20,9 @@ export class ResolvedDataNotFound {
|
|
|
21
20
|
this.name = name;
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
|
-
export const resolvedValues = (f) =>
|
|
25
|
-
export const resolved = (name, f) =>
|
|
26
|
-
export const focusedOptionValue =
|
|
23
|
+
export const resolvedValues = (f) => Effect.serviceWithEffect(InteractionContext)((a) => tsplus_module_1.match(() => Effect.fail(new ResolvedDataNotFound(a)), Effect.succeed)(IxHelpers.resolveValues(f)(a)));
|
|
24
|
+
export const resolved = (name, f) => Effect.serviceWithEffect(InteractionContext)((a) => tsplus_module_1.match(() => Effect.fail(new ResolvedDataNotFound(a, name)), Effect.succeed)(IxHelpers.resolveOptionValue(name, f)(a)));
|
|
25
|
+
export const focusedOptionValue = Effect.serviceWith(FocusedOptionContext)((a) => a.focusedOption.value ?? "");
|
|
27
26
|
export class SubCommandNotFound {
|
|
28
27
|
data;
|
|
29
28
|
_tag = "SubCommandNotFound";
|
|
@@ -31,9 +30,10 @@ export class SubCommandNotFound {
|
|
|
31
30
|
this.data = data;
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
|
-
export const handleSubCommands = (commands) => tsplus_module_2.flatMap((data) =>
|
|
35
|
-
export const currentSubCommand =
|
|
36
|
-
|
|
33
|
+
export const handleSubCommands = (commands) => tsplus_module_2.flatMap((data) => pipe(IxHelpers.allSubCommands(data), Arr.findFirst((a) => !!commands[a.name]), (o) => tsplus_module_1.toEither(() => new SubCommandNotFound(data))(o), Effect.fromEither, (a) => tsplus_module_2.flatMap((command) => pipe(commands[command.name], Effect.provideService(SubCommandContext)({ command })))(a)))(Effect.service(ApplicationCommandContext));
|
|
34
|
+
export const currentSubCommand = Effect.serviceWith(SubCommandContext)((a) => a.command);
|
|
35
|
+
const _hashmap = HashMap.empty;
|
|
36
|
+
export const optionsMap = Effect.serviceWith(ApplicationCommandContext)(IxHelpers.optionsMap);
|
|
37
37
|
export class RequiredOptionNotFound {
|
|
38
38
|
data;
|
|
39
39
|
name;
|
|
@@ -43,8 +43,8 @@ export class RequiredOptionNotFound {
|
|
|
43
43
|
this.name = name;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
export const option = (name) =>
|
|
47
|
-
export const optionValue = (name) => tsplus_module_2.flatMap((o) =>
|
|
48
|
-
export const optionValueOptional = (name) => tsplus_module_2.map((o) =>
|
|
49
|
-
export const modalValues =
|
|
46
|
+
export const option = (name) => Effect.serviceWith(ApplicationCommandContext)(IxHelpers.getOption(name));
|
|
47
|
+
export const optionValue = (name) => tsplus_module_2.flatMap((o) => tsplus_module_1.match(() => tsplus_module_2.flatMap((data) => Effect.fail(new RequiredOptionNotFound(data, name)))(command), Effect.succeed)(tsplus_module_1.flatMapNullable((a) => a.value)(o)))(option(name));
|
|
48
|
+
export const optionValueOptional = (name) => tsplus_module_2.map((o) => tsplus_module_1.flatMapNullable((a) => a.value)(o))(option(name));
|
|
49
|
+
export const modalValues = Effect.serviceWith(ModalSubmitContext)(IxHelpers.componentsMap);
|
|
50
50
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/Interactions/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/Interactions/context.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAA;AAChD,OAAO,EAAE,OAAO,EAAW,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAA;AAEvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,EAAuB,CAAA;AACpE,MAAM,CAAC,MAAM,yBAAyB,GACpC,OAAO,CAAC,GAAG,EAAmC,CAAA;AAChD,MAAM,CAAC,MAAM,uBAAuB,GAClC,OAAO,CAAC,GAAG,EAAiC,CAAA;AAC9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC,G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dfx/utils/common";
|
|
3
|
-
import { Effect, EffectTypeId } from "@effect/io/Effect";
|
|
4
|
-
import { FocusedOptionContext, ResolvedDataNotFound, SubCommandContext } from "./context.js";
|
|
1
|
+
import { Discord, Effect, Option } from "dfx/_common";
|
|
5
2
|
import type { F } from "ts-toolbelt";
|
|
3
|
+
import { FocusedOptionContext, ResolvedDataNotFound, SubCommandContext } from "./context.js";
|
|
6
4
|
type DescriptionMissing<A> = A extends {
|
|
7
5
|
type: Exclude<Discord.ApplicationCommandType, 1>;
|
|
8
6
|
} ? false : A extends {
|
|
@@ -15,58 +13,60 @@ export declare class GlobalApplicationCommand<R, E> {
|
|
|
15
13
|
readonly _tag = "GlobalApplicationCommand";
|
|
16
14
|
constructor(command: Discord.CreateGlobalApplicationCommandParams, handle: CommandHandler<R, E>);
|
|
17
15
|
}
|
|
18
|
-
export declare const global: <R, E, A extends
|
|
16
|
+
export declare const global: <R, E, A extends Discord.CreateGlobalApplicationCommandParams>(command: F.Narrow<A>, handle: DescriptionMissing<A> extends true ? "command description is missing" : CommandHandler<R, E, A>) => GlobalApplicationCommand<Exclude<R, Discord.Interaction | Discord.ApplicationCommandDatum>, E>;
|
|
19
17
|
export declare class GuildApplicationCommand<R, E> {
|
|
20
18
|
readonly command: Discord.CreateGuildApplicationCommandParams;
|
|
21
19
|
readonly handle: CommandHandler<R, E>;
|
|
22
20
|
readonly _tag = "GuildApplicationCommand";
|
|
23
21
|
constructor(command: Discord.CreateGuildApplicationCommandParams, handle: CommandHandler<R, E>);
|
|
24
22
|
}
|
|
25
|
-
export declare const guild: <R, E, A extends
|
|
23
|
+
export declare const guild: <R, E, A extends Discord.CreateGuildApplicationCommandParams>(command: F.Narrow<A>, handle: DescriptionMissing<A> extends true ? "command description is missing" : CommandHandler<R, E, A>) => GuildApplicationCommand<Exclude<R, Discord.Interaction | Discord.ApplicationCommandDatum>, E>;
|
|
26
24
|
export declare class MessageComponent<R, E> {
|
|
27
|
-
readonly predicate: (customId: string) => Effect<R, E, boolean>;
|
|
28
|
-
readonly handle: Effect<R, E, Discord.InteractionResponse>;
|
|
25
|
+
readonly predicate: (customId: string) => Effect.Effect<R, E, boolean>;
|
|
26
|
+
readonly handle: Effect.Effect<R, E, Discord.InteractionResponse>;
|
|
29
27
|
readonly _tag = "MessageComponent";
|
|
30
|
-
constructor(predicate: (customId: string) => Effect<R, E, boolean>, handle: Effect<R, E, Discord.InteractionResponse>);
|
|
28
|
+
constructor(predicate: (customId: string) => Effect.Effect<R, E, boolean>, handle: Effect.Effect<R, E, Discord.InteractionResponse>);
|
|
31
29
|
}
|
|
32
|
-
export declare const messageComponent: <R1, R2, E1, E2>(pred: (customId: string) => Effect<R1, E1, boolean>, handle: CommandHandler<R2, E2,
|
|
30
|
+
export declare const messageComponent: <R1, R2, E1, E2>(pred: (customId: string) => Effect.Effect<R1, E1, boolean>, handle: CommandHandler<R2, E2, Discord.InteractionResponse>) => MessageComponent<Exclude<R1, Discord.Interaction | Discord.MessageComponentDatum> | Exclude<R2, Discord.Interaction | Discord.MessageComponentDatum>, E1 | E2>;
|
|
33
31
|
export declare class ModalSubmit<R, E> {
|
|
34
|
-
readonly predicate: (customId: string) => Effect<R, E, boolean>;
|
|
35
|
-
readonly handle: Effect<R, E, Discord.InteractionResponse>;
|
|
32
|
+
readonly predicate: (customId: string) => Effect.Effect<R, E, boolean>;
|
|
33
|
+
readonly handle: Effect.Effect<R, E, Discord.InteractionResponse>;
|
|
36
34
|
readonly _tag = "ModalSubmit";
|
|
37
|
-
constructor(predicate: (customId: string) => Effect<R, E, boolean>, handle: Effect<R, E, Discord.InteractionResponse>);
|
|
35
|
+
constructor(predicate: (customId: string) => Effect.Effect<R, E, boolean>, handle: Effect.Effect<R, E, Discord.InteractionResponse>);
|
|
38
36
|
}
|
|
39
|
-
export declare const modalSubmit: <R1, R2, E1, E2>(pred: (customId: string) => Effect<R1, E1, boolean>, handle: Effect<R2, E2,
|
|
37
|
+
export declare const modalSubmit: <R1, R2, E1, E2>(pred: (customId: string) => Effect.Effect<R1, E1, boolean>, handle: Effect.Effect<R2, E2, Discord.InteractionResponse>) => ModalSubmit<Exclude<R1, Discord.Interaction | Discord.ModalSubmitDatum> | Exclude<R2, Discord.Interaction | Discord.ModalSubmitDatum>, E1 | E2>;
|
|
40
38
|
export declare class Autocomplete<R, E> {
|
|
41
|
-
readonly predicate: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => Effect<R, E, boolean>;
|
|
42
|
-
readonly handle: Effect<R, E, Discord.InteractionResponse>;
|
|
39
|
+
readonly predicate: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => Effect.Effect<R, E, boolean>;
|
|
40
|
+
readonly handle: Effect.Effect<R, E, Discord.InteractionResponse>;
|
|
43
41
|
readonly _tag = "Autocomplete";
|
|
44
|
-
constructor(predicate: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => Effect<R, E, boolean>, handle: Effect<R, E, Discord.InteractionResponse>);
|
|
42
|
+
constructor(predicate: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => Effect.Effect<R, E, boolean>, handle: Effect.Effect<R, E, Discord.InteractionResponse>);
|
|
45
43
|
}
|
|
46
|
-
export declare const autocomplete: <R1, R2, E1, E2>(pred: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => Effect<R1, E1, boolean>, handle: Effect<R2, E2,
|
|
47
|
-
type CommandHandler<R, E, A = any> = Effect<R, E, Discord.InteractionResponse> | CommandHandlerFn<R, E, A>;
|
|
44
|
+
export declare const autocomplete: <R1, R2, E1, E2>(pred: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => Effect.Effect<R1, E1, boolean>, handle: Effect.Effect<R2, E2, Discord.InteractionResponse>) => Autocomplete<Exclude<R1, Discord.Interaction | Discord.ApplicationCommandDatum | FocusedOptionContext> | Exclude<R2, Discord.Interaction | Discord.ApplicationCommandDatum | FocusedOptionContext>, E1 | E2>;
|
|
45
|
+
type CommandHandler<R, E, A = any> = Effect.Effect<R, E, Discord.InteractionResponse> | CommandHandlerFn<R, E, A>;
|
|
48
46
|
export interface CommandHelper<A> {
|
|
49
|
-
resolve: <T>(name: AllResolvables<A>["name"], f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => T | undefined) => Effect<Discord.Interaction, ResolvedDataNotFound, T>;
|
|
50
|
-
option: (name: AllCommandOptions<A>["name"]) => Effect<Discord.ApplicationCommandDatum, never,
|
|
51
|
-
optionValue: <N extends AllRequiredCommandOptions<A>["name"]>(name: N) => Effect<Discord.ApplicationCommandDatum, never, CommandValue<A, N>>;
|
|
52
|
-
optionValueOptional: <N extends AllCommandOptions<A>["name"]>(name: N) => Effect<Discord.ApplicationCommandDatum, never,
|
|
53
|
-
subCommands: <NER extends SubCommandNames<A> extends never ? never : Record<SubCommandNames<A>, Effect<any, any, Discord.InteractionResponse>>>(commands: NER) => Effect<Exclude<[
|
|
47
|
+
resolve: <T>(name: AllResolvables<A>["name"], f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => T | undefined) => Effect.Effect<Discord.Interaction, ResolvedDataNotFound, T>;
|
|
48
|
+
option: (name: AllCommandOptions<A>["name"]) => Effect.Effect<Discord.ApplicationCommandDatum, never, Option.Option<Discord.ApplicationCommandInteractionDataOption>>;
|
|
49
|
+
optionValue: <N extends AllRequiredCommandOptions<A>["name"]>(name: N) => Effect.Effect<Discord.ApplicationCommandDatum, never, CommandValue<A, N>>;
|
|
50
|
+
optionValueOptional: <N extends AllCommandOptions<A>["name"]>(name: N) => Effect.Effect<Discord.ApplicationCommandDatum, never, Option.Option<CommandValue<A, N>>>;
|
|
51
|
+
subCommands: <NER extends SubCommandNames<A> extends never ? never : Record<SubCommandNames<A>, Effect.Effect<any, any, Discord.InteractionResponse>>>(commands: NER) => Effect.Effect<Exclude<[
|
|
54
52
|
NER[keyof NER]
|
|
55
53
|
] extends [
|
|
56
54
|
{
|
|
57
|
-
[EffectTypeId]: {
|
|
55
|
+
[Effect.EffectTypeId]: {
|
|
58
56
|
_R: (_: never) => infer R;
|
|
59
57
|
};
|
|
60
58
|
}
|
|
61
59
|
] ? R : never, SubCommandContext> | Discord.Interaction | Discord.ApplicationCommandDatum, [
|
|
62
60
|
NER[keyof NER]
|
|
63
|
-
] extends [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
] extends [
|
|
62
|
+
{
|
|
63
|
+
[Effect.EffectTypeId]: {
|
|
64
|
+
_E: (_: never) => infer E;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
] ? E : never, Discord.InteractionResponse>;
|
|
68
68
|
}
|
|
69
|
-
type CommandHandlerFn<R, E, A> = (i: CommandHelper<A>) => Effect<R, E, Discord.InteractionResponse>;
|
|
69
|
+
type CommandHandlerFn<R, E, A> = (i: CommandHelper<A>) => Effect.Effect<R, E, Discord.InteractionResponse>;
|
|
70
70
|
type SubCommands<A> = A extends {
|
|
71
71
|
type: Discord.ApplicationCommandOptionType.SUB_COMMAND;
|
|
72
72
|
options?: Discord.ApplicationCommandOption[];
|
|
@@ -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,EAAE,OAAO,EAAE,MAAM,EAAU,MAAM,aAAa,CAAA;AAuBrD,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,CAAC;CACL;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,CAKpB,OAAoB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AAY,GAAG,CAC1B,IAGmC,EACnC,MAA0D,EAC1D,EAAE,CACF,IAAI,YAAY,CAQd,IAAW,EAAE,MAAa,CAAC,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Effect } from "dfx/utils/common";
|
|
2
|
-
import { DiscordREST, Discord, FetchError, StatusCodeError, JsonParseError } from "dfx";
|
|
3
1
|
import { DefinitionNotFound } from "./handlers.js";
|
|
4
2
|
import { InteractionBuilder } from "./index.js";
|
|
3
|
+
import { Discord, Effect } from "dfx/_common";
|
|
4
|
+
import { DiscordREST, FetchError, JsonParseError, StatusCodeError } from "dfx";
|
|
5
|
+
import { Gateway } from "dfx/gateway";
|
|
5
6
|
export interface RunOpts {
|
|
6
7
|
sync?: boolean;
|
|
7
8
|
}
|
|
@@ -9,4 +10,4 @@ export interface RunOpts {
|
|
|
9
10
|
* @tsplus pipeable dfx/InteractionBuilder runGateway
|
|
10
11
|
* @tsplus location "dfx/Interactions/gateway"
|
|
11
12
|
*/
|
|
12
|
-
export declare const run: <R, R2, E, E2>(postHandler: (effect:
|
|
13
|
+
export declare const run: <R, R2, E, E2>(postHandler: (effect: Effect.Effect<R | DiscordREST | Discord.Interaction, E | FetchError | StatusCodeError | JsonParseError | DefinitionNotFound, void>) => Effect.Effect<R2, E2, void>, { sync }?: RunOpts) => (ix: InteractionBuilder<R, E>) => Effect.Effect<DiscordREST | Gateway.DiscordGateway | Exclude<R2, Discord.Interaction>, E2 | FetchError | StatusCodeError | JsonParseError, void>;
|
package/Interactions/gateway.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@effect/io/Effect";
|
|
2
|
-
import * as tsplus_module_2 from "dfx/utils/common";
|
|
3
|
-
import * as tsplus_module_3 from "dfx";
|
|
4
|
-
import * as tsplus_module_4 from "dfx/gateway";
|
|
5
2
|
import { handlers } from "./handlers.js";
|
|
6
3
|
import { InteractionContext } from "./index.js";
|
|
7
4
|
import { splitDefinitions } from "./utils.js";
|
|
5
|
+
import { Effect, pipe, } from "dfx/_common";
|
|
6
|
+
import { DiscordREST } from "dfx";
|
|
7
|
+
import { Gateway } from "dfx/gateway";
|
|
8
8
|
/**
|
|
9
9
|
* @tsplus pipeable dfx/InteractionBuilder runGateway
|
|
10
10
|
*/
|
|
@@ -16,10 +16,10 @@ export const run = (postHandler, { sync = true } = {}) => (ix) => (() => {
|
|
|
16
16
|
});
|
|
17
17
|
const guildSync = GuildApplicationCommand.length
|
|
18
18
|
? gateway.handleDispatch("GUILD_CREATE", (a) => rest.bulkOverwriteGuildApplicationCommands(application.id, a.id, GuildApplicationCommand.map((a) => a.command)))
|
|
19
|
-
:
|
|
19
|
+
: Effect.unit();
|
|
20
20
|
const handle = handlers(ix.definitions);
|
|
21
|
-
const run = gateway.handleDispatch("INTERACTION_CREATE", (i) =>
|
|
21
|
+
const run = gateway.handleDispatch("INTERACTION_CREATE", (i) => pipe(tsplus_module_1.tap((r) => rest.createInteractionResponse(i.id, i.token, r))(handle[i.type](i)), postHandler, Effect.provideService(InteractionContext)(i)));
|
|
22
22
|
return tsplus_module_1.map(() => void 0)(sync ? tsplus_module_1.zipPar(guildSync)(tsplus_module_1.zipPar(globalSync)(run)) : run);
|
|
23
|
-
})(tsplus_module_1.flatMap((a) => a.json)(rest.getCurrentBotApplicationInformation())))(
|
|
23
|
+
})(tsplus_module_1.flatMap((a) => a.json)(rest.getCurrentBotApplicationInformation())))(Effect.service(DiscordREST)))(Effect.service(Gateway.DiscordGateway));
|
|
24
24
|
})();
|
|
25
25
|
//# sourceMappingURL=gateway.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../src/Interactions/gateway.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../src/Interactions/gateway.ts"],"names":[],"mappings":";AAAA,OAAO,EAAsB,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC5D,OA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AE,CAAC,CAAC,EAAE,EAAE,CAC7D,IAAI,CACF,oBAAsB,CAAC,CAAC,EAAE,EAAE,CAC1B,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EADlD,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAEhB,EACD,WAAW,EACX,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAC7C,CACF,CAAA;iDAEC,IAAI,CAAC,CAAC,CAAC,uBAA8B,SAAS,EAAvC,uBAAW,UAAU,EAArB,GAAG,CAAmB,CAAkB,CAAC,CAAC,CAAC,GAAG;OAhCrD,wBAAmD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAhE,IAAI,CAAC,mCAAmC,EAAE,CAAuB,GAHpD,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,GADxB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC;IAqCxD,CAAA"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { Discord } from "dfx";
|
|
2
|
-
import { Effect } from "dfx/utils/common";
|
|
1
|
+
import { Discord, Effect } from "dfx/_common";
|
|
3
2
|
import * as D from "./definitions.js";
|
|
4
3
|
export declare class DefinitionNotFound {
|
|
5
4
|
readonly interaction: Discord.Interaction;
|
|
6
5
|
readonly _tag = "DefinitionNotFound";
|
|
7
6
|
constructor(interaction: Discord.Interaction);
|
|
8
7
|
}
|
|
9
|
-
type Handler<R, E> = Effect<R | Discord.Interaction, E | DefinitionNotFound, Discord.InteractionResponse>;
|
|
10
|
-
export declare const handlers: <R, E>(definitions: D.InteractionDefinition<R, E>[]) => Record<
|
|
8
|
+
type Handler<R, E> = Effect.Effect<R | Discord.Interaction, E | DefinitionNotFound, Discord.InteractionResponse>;
|
|
9
|
+
export declare const handlers: <R, E>(definitions: D.InteractionDefinition<R, E>[]) => Record<Discord.InteractionType, (i: Discord.Interaction) => Handler<R, E>>;
|
|
11
10
|
export {};
|
package/Interactions/handlers.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "
|
|
2
|
-
import * as tsplus_module_2 from "@
|
|
3
|
-
import * as tsplus_module_3 from "@
|
|
4
|
-
import * as tsplus_module_4 from "dfx/utils/common";
|
|
5
|
-
import * as tsplus_module_5 from "@fp-ts/data/Chunk";
|
|
6
|
-
import * as Ctx from "./context.js";
|
|
1
|
+
import * as tsplus_module_1 from "@fp-ts/data/Option";
|
|
2
|
+
import * as tsplus_module_2 from "@fp-ts/data/Chunk";
|
|
3
|
+
import * as tsplus_module_3 from "@effect/io/Effect";
|
|
7
4
|
import * as Arr from "@fp-ts/data/ReadonlyArray";
|
|
5
|
+
import { IxHelpers } from "dfx";
|
|
6
|
+
import { Discord, Effect, Option, pipe } from "dfx/_common";
|
|
7
|
+
import * as Ctx from "./context.js";
|
|
8
8
|
import { splitDefinitions } from "./utils.js";
|
|
9
9
|
export class DefinitionNotFound {
|
|
10
10
|
interaction;
|
|
@@ -23,35 +23,35 @@ const context = {
|
|
|
23
23
|
export const handlers = (definitions) => {
|
|
24
24
|
const { Commands, Autocomplete, MessageComponent, ModalSubmit } = splitDefinitions(definitions);
|
|
25
25
|
return {
|
|
26
|
-
[
|
|
27
|
-
type:
|
|
26
|
+
[Discord.InteractionType.PING]: () => Effect.succeed({
|
|
27
|
+
type: Discord.InteractionCallbackType.PONG,
|
|
28
28
|
}),
|
|
29
|
-
[
|
|
29
|
+
[Discord.InteractionType.APPLICATION_COMMAND]: (i) => {
|
|
30
30
|
const data = i.data;
|
|
31
|
-
return
|
|
31
|
+
return pipe(tsplus_module_1.match(() => Effect.fail(new DefinitionNotFound(i)), (command) => Effect.isEffect(command.handle)
|
|
32
32
|
? command.handle
|
|
33
|
-
: command.handle(context))(
|
|
33
|
+
: command.handle(context))(Option.fromNullable(Commands[data.name])), (a) => a, Effect.provideService(Ctx.ApplicationCommandContext)(data));
|
|
34
34
|
},
|
|
35
|
-
[
|
|
35
|
+
[Discord.InteractionType.MODAL_SUBMIT]: (i) => {
|
|
36
36
|
const data = i.data;
|
|
37
|
-
return
|
|
38
|
-
command:
|
|
37
|
+
return pipe(ModalSubmit, Arr.map((a) => Effect.struct({
|
|
38
|
+
command: Effect.succeed(a),
|
|
39
39
|
match: a.predicate(data.custom_id),
|
|
40
|
-
})), (a) =>
|
|
40
|
+
})), (a) => tsplus_module_3.flatMap((a) => tsplus_module_1.match(() => Effect.fail(new DefinitionNotFound(i)), (a) => a.command.handle)(tsplus_module_2.findFirst((a) => a.match)(a)))(tsplus_module_3.collectAllPar(a)), Effect.provideService(Ctx.ModalSubmitContext)(data));
|
|
41
41
|
},
|
|
42
|
-
[
|
|
42
|
+
[Discord.InteractionType.MESSAGE_COMPONENT]: (i) => {
|
|
43
43
|
const data = i.data;
|
|
44
|
-
return
|
|
45
|
-
command:
|
|
44
|
+
return pipe(MessageComponent, Arr.map((a) => Effect.struct({
|
|
45
|
+
command: Effect.succeed(a),
|
|
46
46
|
match: a.predicate(data.custom_id),
|
|
47
|
-
})), (a) =>
|
|
47
|
+
})), (a) => tsplus_module_3.flatMap((a) => tsplus_module_1.match(() => Effect.fail(new DefinitionNotFound(i)), (a) => a.command.handle)(tsplus_module_2.findFirst((a) => a.match)(a)))(tsplus_module_3.collectAllPar(a)), Effect.provideService(Ctx.MessageComponentContext)(data));
|
|
48
48
|
},
|
|
49
|
-
[
|
|
49
|
+
[Discord.InteractionType.APPLICATION_COMMAND_AUTOCOMPLETE]: (i) => {
|
|
50
50
|
const data = i.data;
|
|
51
|
-
return
|
|
52
|
-
command:
|
|
51
|
+
return tsplus_module_1.getOrElse(() => Effect.fail(new DefinitionNotFound(i)))(tsplus_module_1.map((focusedOption) => pipe(Autocomplete, Arr.map((a) => Effect.struct({
|
|
52
|
+
command: Effect.succeed(a),
|
|
53
53
|
match: a.predicate(data, focusedOption),
|
|
54
|
-
})), (a) =>
|
|
54
|
+
})), (a) => tsplus_module_3.flatMap((a) => tsplus_module_1.match(() => Effect.fail(new DefinitionNotFound(i)), (a) => a.command.handle)(tsplus_module_2.findFirst((a) => a.match)(a)))(tsplus_module_3.collectAllPar(a)), Effect.provideService(Ctx.ApplicationCommandContext)(data), Effect.provideService(Ctx.FocusedOptionContext)({ focusedOption })))(IxHelpers.focusedOption(data)));
|
|
55
55
|
},
|
|
56
56
|
};
|
|
57
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/Interactions/handlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/Interactions/handlers.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AAEnC,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,OAAO,GAAyB;IACpC,OAAO,EAAE,GAAG,CAAC,QAAQ;IACrB,MAAM,EAAE,GAAG,CAAC,MAAM;IAClB,WAAW,EAAE,GAAG,CAAC,WAAW;IAC5B,mBAAmB,EAAE,GAAG,CAAC,mBAAmB;IAC5C,WAAW,EAAE,GAAG,CAAC,iBAAiB;CAC5B,CAAA;AAER,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,WAA4C,EAI5C,EAAE;IACF,MAAM,EAAE,QAAQ,EAAE,YAAY,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@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DiscordREST } from "dfx";
|
|
2
|
+
import { Discord, Effect } from "dfx/_common";
|
|
3
3
|
import * as D from "./definitions.js";
|
|
4
|
-
export * from "./context.js";
|
|
5
|
-
export { global, guild, messageComponent, modalSubmit, autocomplete, InteractionDefinition, } from "./definitions.js";
|
|
6
4
|
export { response as r } from "../Helpers/interactions.js";
|
|
5
|
+
export * from "./context.js";
|
|
6
|
+
export { autocomplete, global, guild, InteractionDefinition, messageComponent, modalSubmit, } from "./definitions.js";
|
|
7
7
|
/**
|
|
8
8
|
* @tsplus type dfx/InteractionBuilder
|
|
9
9
|
*/
|
|
@@ -12,12 +12,12 @@ export declare class InteractionBuilder<R, E> {
|
|
|
12
12
|
constructor(definitions: D.InteractionDefinition<R, E>[]);
|
|
13
13
|
add<R1, E1>(definition: D.InteractionDefinition<R1, E1>): InteractionBuilder<R | R1, E | E1>;
|
|
14
14
|
concat<R1, E1>(builder: InteractionBuilder<R1, E1>): InteractionBuilder<R | R1, E | E1>;
|
|
15
|
-
get syncGlobal():
|
|
16
|
-
syncGuild(appId: Discord.Snowflake, guildId: Discord.Snowflake):
|
|
15
|
+
get syncGlobal(): Effect.Effect<DiscordREST, import("dfx").FetchError | import("dfx").StatusCodeError | import("dfx").JsonParseError, import("../DiscordREST/types.js").ResponseWithData<Discord.ApplicationCommand[]>>;
|
|
16
|
+
syncGuild(appId: Discord.Snowflake, guildId: Discord.Snowflake): Effect.Effect<DiscordREST, import("dfx").FetchError | import("dfx").StatusCodeError | import("dfx").JsonParseError, import("../DiscordREST/types.js").ResponseWithData<Discord.ApplicationCommand[]>>;
|
|
17
17
|
}
|
|
18
18
|
export declare const builder: InteractionBuilder<never, never>;
|
|
19
|
-
export declare const id: (query: string) => (customId: string) =>
|
|
20
|
-
export declare const idStartsWith: (query: string) => (customId: string) =>
|
|
21
|
-
export declare const idRegex: (query: RegExp) => (customId: string) =>
|
|
22
|
-
export declare const option: (command: string, optionName: string) => (data: Pick<Discord.ApplicationCommandDatum, "name">, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) =>
|
|
23
|
-
export declare const optionOnly: (optionName: string) => (_: unknown, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) =>
|
|
19
|
+
export declare const id: (query: string) => (customId: string) => Effect.Effect<never, never, boolean>;
|
|
20
|
+
export declare const idStartsWith: (query: string) => (customId: string) => Effect.Effect<never, never, boolean>;
|
|
21
|
+
export declare const idRegex: (query: RegExp) => (customId: string) => Effect.Effect<never, never, boolean>;
|
|
22
|
+
export declare const option: (command: string, optionName: string) => (data: Pick<Discord.ApplicationCommandDatum, "name">, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) => Effect.Effect<never, never, boolean>;
|
|
23
|
+
export declare const optionOnly: (optionName: string) => (_: unknown, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) => Effect.Effect<never, never, boolean>;
|
package/Interactions/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@effect/io/Effect";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export { global, guild, messageComponent, modalSubmit, autocomplete, } from "./definitions.js";
|
|
2
|
+
import { DiscordREST } from "dfx";
|
|
3
|
+
import { Effect } from "dfx/_common";
|
|
5
4
|
export { response as r } from "../Helpers/interactions.js";
|
|
5
|
+
export * from "./context.js";
|
|
6
|
+
export { autocomplete, global, guild, messageComponent, modalSubmit, } from "./definitions.js";
|
|
6
7
|
/**
|
|
7
8
|
* @tsplus type dfx/InteractionBuilder
|
|
8
9
|
*/
|
|
@@ -27,7 +28,7 @@ export class InteractionBuilder {
|
|
|
27
28
|
const commands = this.definitions
|
|
28
29
|
.filter((c) => c._tag === "GlobalApplicationCommand")
|
|
29
30
|
.map((c) => c.command);
|
|
30
|
-
return
|
|
31
|
+
return Effect.serviceWithEffect(DiscordREST)((rest) => tsplus_module_1.flatMap((app) => rest.bulkOverwriteGlobalApplicationCommands(app.id, {
|
|
31
32
|
body: JSON.stringify(commands),
|
|
32
33
|
}))(tsplus_module_1.flatMap((r) => r.json)(rest
|
|
33
34
|
.getCurrentBotApplicationInformation())));
|
|
@@ -36,14 +37,14 @@ export class InteractionBuilder {
|
|
|
36
37
|
const commands = this.definitions
|
|
37
38
|
.filter((c) => c._tag === "GuildApplicationCommand")
|
|
38
39
|
.map((c) => c.command);
|
|
39
|
-
return
|
|
40
|
+
return Effect.serviceWithEffect(DiscordREST)((rest) => rest.bulkOverwriteGuildApplicationCommands(appId, guildId, commands));
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
export const builder = new InteractionBuilder([]);
|
|
43
44
|
// Filters
|
|
44
|
-
export const id = (query) => (customId) =>
|
|
45
|
-
export const idStartsWith = (query) => (customId) =>
|
|
46
|
-
export const idRegex = (query) => (customId) =>
|
|
47
|
-
export const option = (command, optionName) => (data, focusedOption) =>
|
|
48
|
-
export const optionOnly = (optionName) => (_, focusedOption) =>
|
|
45
|
+
export const id = (query) => (customId) => Effect.succeed(query === customId);
|
|
46
|
+
export const idStartsWith = (query) => (customId) => Effect.succeed(customId.startsWith(query));
|
|
47
|
+
export const idRegex = (query) => (customId) => Effect.succeed(query.test(customId));
|
|
48
|
+
export const option = (command, optionName) => (data, focusedOption) => Effect.succeed(data.name === command && focusedOption.name === optionName);
|
|
49
|
+
export const optionOnly = (optionName) => (_, focusedOption) => Effect.succeed(focusedOption.name === optionName);
|
|
49
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Interactions/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Interactions/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AACjC,OAAO,EAAW,MAAM,EAAE,MAAM,aAAa,CAAA;AA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