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.
Files changed (119) hide show
  1. package/Cache/driver.d.ts +16 -16
  2. package/Cache/driver.js.map +1 -1
  3. package/Cache/index.d.ts +21 -21
  4. package/Cache/index.js +12 -13
  5. package/Cache/index.js.map +1 -1
  6. package/Cache/memory.d.ts +3 -3
  7. package/Cache/memory.js +19 -20
  8. package/Cache/memory.js.map +1 -1
  9. package/Cache/memoryTTL.d.ts +5 -5
  10. package/Cache/memoryTTL.js +16 -16
  11. package/Cache/memoryTTL.js.map +1 -1
  12. package/Cache/prelude.d.ts +41 -41
  13. package/Cache/prelude.js +39 -41
  14. package/Cache/prelude.js.map +1 -1
  15. package/DiscordConfig/index.d.ts +4 -19
  16. package/DiscordConfig/index.js +5 -12
  17. package/DiscordConfig/index.js.map +1 -1
  18. package/DiscordGateway/DiscordWS/index.d.ts +9 -9
  19. package/DiscordGateway/DiscordWS/index.js +16 -20
  20. package/DiscordGateway/DiscordWS/index.js.map +1 -1
  21. package/DiscordGateway/Shard/heartbeats.d.ts +3 -4
  22. package/DiscordGateway/Shard/heartbeats.js +9 -16
  23. package/DiscordGateway/Shard/heartbeats.js.map +1 -1
  24. package/DiscordGateway/Shard/identify.d.ts +4 -4
  25. package/DiscordGateway/Shard/identify.js +5 -4
  26. package/DiscordGateway/Shard/identify.js.map +1 -1
  27. package/DiscordGateway/Shard/index.d.ts +8 -7
  28. package/DiscordGateway/Shard/index.js +17 -20
  29. package/DiscordGateway/Shard/index.js.map +1 -1
  30. package/DiscordGateway/Shard/invalidSession.d.ts +2 -3
  31. package/DiscordGateway/Shard/invalidSession.js +5 -8
  32. package/DiscordGateway/Shard/invalidSession.js.map +1 -1
  33. package/DiscordGateway/Shard/sendEvents.d.ts +1 -1
  34. package/DiscordGateway/Shard/sendEvents.js +7 -7
  35. package/DiscordGateway/Shard/sendEvents.js.map +1 -1
  36. package/DiscordGateway/Shard/utils.d.ts +3 -4
  37. package/DiscordGateway/Shard/utils.js +6 -6
  38. package/DiscordGateway/Shard/utils.js.map +1 -1
  39. package/DiscordGateway/ShardStore/index.d.ts +6 -6
  40. package/DiscordGateway/ShardStore/index.js +7 -10
  41. package/DiscordGateway/ShardStore/index.js.map +1 -1
  42. package/DiscordGateway/Sharder/index.d.ts +11 -11
  43. package/DiscordGateway/Sharder/index.js +21 -42
  44. package/DiscordGateway/Sharder/index.js.map +1 -1
  45. package/DiscordGateway/WS/index.d.ts +3 -2
  46. package/DiscordGateway/WS/index.js +30 -40
  47. package/DiscordGateway/WS/index.js.map +1 -1
  48. package/DiscordGateway/index.d.ts +8 -9
  49. package/DiscordGateway/index.js +10 -15
  50. package/DiscordGateway/index.js.map +1 -1
  51. package/DiscordREST/index.d.ts +132 -132
  52. package/DiscordREST/index.js +37 -40
  53. package/DiscordREST/index.js.map +1 -1
  54. package/DiscordREST/types.d.ts +6 -6
  55. package/DiscordREST/utils.d.ts +5 -4
  56. package/DiscordREST/utils.js +5 -5
  57. package/DiscordREST/utils.js.map +1 -1
  58. package/Helpers/intents.js +8 -8
  59. package/Helpers/intents.js.map +1 -1
  60. package/Helpers/interactions.d.ts +18 -19
  61. package/Helpers/interactions.js +22 -23
  62. package/Helpers/interactions.js.map +1 -1
  63. package/Helpers/members.d.ts +2 -2
  64. package/Helpers/members.js.map +1 -1
  65. package/Helpers/permissions.d.ts +4 -4
  66. package/Helpers/permissions.js +13 -13
  67. package/Helpers/permissions.js.map +1 -1
  68. package/Http/index.d.ts +10 -9
  69. package/Http/index.js +7 -8
  70. package/Http/index.js.map +1 -1
  71. package/Interactions/context.d.ts +22 -23
  72. package/Interactions/context.js +21 -21
  73. package/Interactions/context.js.map +1 -1
  74. package/Interactions/definitions.d.ts +31 -31
  75. package/Interactions/definitions.js +1 -2
  76. package/Interactions/definitions.js.map +1 -1
  77. package/Interactions/gateway.d.ts +4 -3
  78. package/Interactions/gateway.js +6 -6
  79. package/Interactions/gateway.js.map +1 -1
  80. package/Interactions/handlers.d.ts +3 -4
  81. package/Interactions/handlers.js +23 -23
  82. package/Interactions/handlers.js.map +1 -1
  83. package/Interactions/index.d.ts +11 -11
  84. package/Interactions/index.js +11 -10
  85. package/Interactions/index.js.map +1 -1
  86. package/Interactions/webhook.d.ts +7 -8
  87. package/Interactions/webhook.js +11 -12
  88. package/Interactions/webhook.js.map +1 -1
  89. package/Log/index.d.ts +8 -7
  90. package/Log/index.js +9 -11
  91. package/Log/index.js.map +1 -1
  92. package/README.md +48 -0
  93. package/RateLimit/index.d.ts +13 -12
  94. package/RateLimit/index.js +11 -12
  95. package/RateLimit/index.js.map +1 -1
  96. package/RateLimit/memory.d.ts +1 -1
  97. package/RateLimit/memory.js +7 -7
  98. package/RateLimit/memory.js.map +1 -1
  99. package/RateLimit/utils.d.ts +2 -2
  100. package/RateLimit/utils.js.map +1 -1
  101. package/_common.d.ts +19 -0
  102. package/_common.js +20 -0
  103. package/_common.js.map +1 -0
  104. package/gateway.d.ts +11 -10
  105. package/gateway.js +17 -14
  106. package/gateway.js.map +1 -1
  107. package/package.json +10 -16
  108. package/utils/effect.d.ts +8 -8
  109. package/utils/effect.js +4 -4
  110. package/utils/effect.js.map +1 -1
  111. package/webhooks.d.ts +6 -5
  112. package/webhooks.js +12 -8
  113. package/webhooks.js.map +1 -1
  114. package/global.d.ts +0 -21
  115. package/global.js +0 -2
  116. package/global.js.map +0 -1
  117. package/utils/common.d.ts +0 -18
  118. package/utils/common.js +0 -3
  119. package/utils/common.js.map +0 -1
@@ -1,51 +1,50 @@
1
- import { Discord } from "dfx";
2
- import { Effect, EffectTypeId } from "@effect/io/Effect";
3
- export declare const InteractionContext: import("../utils/common.js").Tag<import("../types.js").Interaction>;
4
- export declare const ApplicationCommandContext: import("../utils/common.js").Tag<import("../types.js").ApplicationCommandDatum>;
5
- export declare const MessageComponentContext: import("../utils/common.js").Tag<import("../types.js").MessageComponentDatum>;
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: import("../utils/common.js").Tag<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: import("../utils/common.js").Tag<SubCommandContext>;
15
- export declare const interaction: Effect<import("../types.js").Interaction, never, import("../types.js").Interaction>;
16
- export declare const command: Effect<import("../types.js").ApplicationCommandDatum, never, import("../types.js").ApplicationCommandDatum>;
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<import("../types.js").Interaction, ResolvedDataNotFound, readonly A[]>;
24
- export declare const resolved: <A>(name: string, f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) => Effect<import("../types.js").Interaction, ResolvedDataNotFound, A>;
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, import("../types.js").InteractionResponse>>>(commands: NER) => Effect<import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum | Exclude<[NER[keyof NER]] extends [{
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), import("../types.js").InteractionResponse>;
40
- export declare const currentSubCommand: Effect<SubCommandContext, never, import("../types.js").ApplicationCommandInteractionDataOption>;
41
- export declare const optionsMap: Effect<import("../types.js").ApplicationCommandDatum, never, import("../utils/common.js").HashMap<string, string | undefined>>;
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<import("../types.js").ApplicationCommandDatum, never, import("../index.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>>;
49
- export declare const optionValue: (name: string) => Effect<import("../types.js").ApplicationCommandDatum, RequiredOptionNotFound, string>;
50
- export declare const optionValueOptional: (name: string) => Effect<import("../types.js").ApplicationCommandDatum, never, import("../index.js").Maybe<string>>;
51
- export declare const modalValues: Effect<import("../types.js").ModalSubmitDatum, never, import("../utils/common.js").HashMap<string, string | undefined>>;
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>>;
@@ -1,17 +1,16 @@
1
- import * as tsplus_module_1 from "dfx/utils/common";
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 = tsplus_module_1.Tag();
8
- export const ApplicationCommandContext = tsplus_module_1.Tag();
9
- export const MessageComponentContext = tsplus_module_1.Tag();
10
- export const ModalSubmitContext = tsplus_module_1.Tag();
11
- export const FocusedOptionContext = tsplus_module_1.Tag();
12
- export const SubCommandContext = tsplus_module_1.Tag();
13
- export const interaction = tsplus_module_2.service(InteractionContext);
14
- export const command = tsplus_module_2.service(ApplicationCommandContext);
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) => tsplus_module_2.serviceWithEffect(InteractionContext)((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new ResolvedDataNotFound(a)), tsplus_module_2.succeed)(IxHelpers.resolveValues(f)(a)));
25
- export const resolved = (name, f) => tsplus_module_2.serviceWithEffect(InteractionContext)((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new ResolvedDataNotFound(a, name)), tsplus_module_2.succeed)(IxHelpers.resolveOptionValue(name, f)(a)));
26
- export const focusedOptionValue = tsplus_module_2.serviceWith(FocusedOptionContext)((a) => a.focusedOption.value ?? "");
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) => tsplus_module_1.pipe(IxHelpers.allSubCommands(data), Arr.findFirst((a) => !!commands[a.name]), (o) => tsplus_module_3.toEither(() => new SubCommandNotFound(data))(o), tsplus_module_2.fromEither, (a) => tsplus_module_2.flatMap((command) => tsplus_module_1.pipe(commands[command.name], tsplus_module_2.provideService(SubCommandContext)({ command })))(a)))(tsplus_module_2.service(ApplicationCommandContext));
35
- export const currentSubCommand = tsplus_module_2.serviceWith(SubCommandContext)((a) => a.command);
36
- export const optionsMap = tsplus_module_2.serviceWith(ApplicationCommandContext)(IxHelpers.optionsMap);
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) => tsplus_module_2.serviceWith(ApplicationCommandContext)(IxHelpers.getOption(name));
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)))(command), tsplus_module_2.succeed)(tsplus_module_3.flatMapNullable((a) => a.value)(o)))(option(name));
48
- export const optionValueOptional = (name) => tsplus_module_2.map((o) => tsplus_module_3.flatMapNullable((a) => a.value)(o))(option(name));
49
- export const modalValues = tsplus_module_2.serviceWith(ModalSubmitContext)(IxHelpers.componentsMap);
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":";;;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,EAAiC,CAAA;AAC3E,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAA,GAAG,EAA4B,CAAA;AAKjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAA,GAAG,EAAwB,CAAA;AAK/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAA,GAAG,EAAqB,CAAA;AAEzD,MAAM,CAAC,MAAM,WAAW,GAAG,wBAAe,kBAAkB,CAAC,CAAA;AAE7D,MAAM,CAAC,MAAM,OAAO,GAAG,wBAAe,yB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AAJ,IAAI,CAAQ;IACpB,CAAC;CACL;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CACrC,MAAM,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;AAE1E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,EAAE,CAC1C,wBAAqB,CAAC,CAAC,EAAE,EAAE,CACzB,sBAGI,GAAG,EAAE,CACH,wBAAgB,CAAC,IAAI,EAAE,EAAE,CACvB,MAAM,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EADrD,OAAO,CAEN,EACH,MAAM,CAAC,OAAO,EAPlB,gCACmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EADjC,CAAC,CACiC,CAO/B,EATL,MAAM,CAAC,IAAI,CAAC,CAUX,CAAA;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE,CAClD,oBAAiB,CAAC,CAAC,EAAE,EAAE,CAAC,gCAAkB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAAhC,CAAC,CAAgC,EAAzD,MAAM,CAAC,IAAI,CAAC,CAA8C,CAAA;AAE5D,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAC/D,SAAS,CAAC,aAAa,CACxB,CAAA"}
@@ -1,8 +1,6 @@
1
- import { Discord } from "dfx";
2
- import { Maybe } from "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 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
+ 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 import("../types.js").CreateGuildApplicationCommandParams>(command: F.Narrow<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
+ 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, 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
+ 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, 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
+ 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, import("../types.js").InteractionResponse>) => Autocomplete<Exclude<R1, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum | FocusedOptionContext> | Exclude<R2, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum | FocusedOptionContext>, E1 | 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, Maybe<Discord.ApplicationCommandInteractionDataOption>>;
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, Maybe<CommandValue<A, N>>>;
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
- [EffectTypeId]: {
65
- _E: (_: never) => infer E;
66
- };
67
- }] ? E : never, Discord.InteractionResponse>;
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,5 +1,4 @@
1
- import * as tsplus_module_1 from "dfx";
2
- import { EffectTypeId } from "@effect/io/Effect";
1
+ import { Discord, Effect } from "dfx/_common";
3
2
  export class GlobalApplicationCommand {
4
3
  command;
5
4
  handle;
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/Interactions/definitions.ts"],"names":[],"mappings":";AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAuBxD,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,EACpB,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1B,IAG4B,EAC5B,MAAmD,EACnD,EAAE,CACF,IAAI,YAAY,CAQd,IAAW,EAAE,MAAa,CAAC,CAAA"}
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,EACpB,MAE2B,EAC3B,EAAE,CACF,IAAI,wBAAwB,CAG1B,OAAc,EAAE,MAAa,CAAC,CAAA;AAElC,MAAM,OAAO,uBAAuB;IAGvB;IACA;IAHF,IAAI,GAAG,yBAAyB,CAAA;IACzC,YACW,OAAoD,EACpD,MAA4B;QAD5B,YAAO,GAAP,OAAO,CAA6C;QACpD,WAAM,GAAN,MAAM,CAAsB;IACpC,CAAC;CACL;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,CAKnB,OAAoB,EACpB,MAE2B,EAC3B,EAAE,CACF,IAAI,uBAAuB,CAGzB,OAAc,EAAE,MAAa,CAAC,CAAA;AAElC,MAAM,OAAO,gBAAgB;IAGhB;IACA;IAHF,IAAI,GAAG,kBAAkB,CAAA;IAClC,YACW,SAA6D,EAC7D,MAAwD;QADxD,cAAS,GAAT,SAAS,CAAoD;QAC7D,WAAM,GAAN,MAAM,CAAkD;IAChE,CAAC;CACL;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,IAA0D,EAC1D,MAA2D,EAC3D,EAAE,CACF,IAAI,gBAAgB,CAGlB,IAAW,EAAE,MAAa,CAAC,CAAA;AAE/B,MAAM,OAAO,WAAW;IAGX;IACA;IAHF,IAAI,GAAG,aAAa,CAAA;IAC7B,YACW,SAA6D,EAC7D,MAAwD;QADxD,cAAS,GAAT,SAAS,CAAoD;QAC7D,WAAM,GAAN,MAAM,CAAkD;IAChE,CAAC;CACL;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,IAA0D,EAC1D,MAA0D,EAC1D,EAAE,CACF,IAAI,WAAW,CAGb,IAAW,EAAE,MAAa,CAAC,CAAA;AAE/B,MAAM,OAAO,YAAY;IAGZ;IAIA;IANF,IAAI,GAAG,cAAc,CAAA;IAC9B,YACW,SAGwB,EACxB,MAAwD;QAJxD,cAAS,GAAT,SAAS,CAGe;QACxB,WAAM,GAAN,MAAM,CAAkD;IAChE,CAAC;CACL;AAED,MAAM,CAAC,MAAM,YAAY,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: import("../utils/common.js").Effect<R | import("../index.js").DiscordREST | import("../types.js").Interaction, E | import("../index.js").FetchError | import("../index.js").StatusCodeError | import("../index.js").JsonParseError | DefinitionNotFound, void>) => import("../utils/common.js").Effect<R2, E2, void>, { sync }?: RunOpts) => (ix: InteractionBuilder<R, E>) => import("../utils/common.js").Effect<import("../index.js").DiscordREST | import("../DiscordGateway/index.js").DiscordGateway | Exclude<R2, import("../types.js").Interaction>, E2 | import("../index.js").FetchError | import("../index.js").StatusCodeError | import("../index.js").JsonParseError, void>;
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>;
@@ -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
- : tsplus_module_1.unit();
19
+ : Effect.unit();
20
20
  const handle = handlers(ix.definitions);
21
- const run = gateway.handleDispatch("INTERACTION_CREATE", (i) => tsplus_module_2.pipe(tsplus_module_1.tap((r) => rest.createInteractionResponse(i.id, i.token, r))(handle[i.type](i)), postHandler, tsplus_module_1.provideService(InteractionContext)(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())))(tsplus_module_1.service(tsplus_module_3.DiscordREST)))(tsplus_module_1.service(tsplus_module_4.Gateway.DiscordGateway));
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":";;;;AAAA,OAAO,EAAsB,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAsB,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAM7C;;GAEG;AACH,MAAM,CAAC,MAAM,GAAG,GACd,CACE,WAMyB,EACzB,EAAE,IAAI,GAAG,IAAI,KAAc,EAAE,EAC7B,EAAE,CACJ,CAAC,EAA4B,EAAE,EAAE;IAE7B,MAAM,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,GACzD,gBAAgB,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;mCAE5B,OAAO,4BACP,IAAI,4BAEJ,WAAW;QAIjB,MAAM,UAAU,GAAG,IAAI,CAAC,sCAAsC,CAC5D,WAAW,CAAC,EAAE,EACd;YACE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;SACrE,CACF,CAAA;QAED,MAAM,SAAS,GAAG,uBAAuB,CAAC,MAAM;YAC9C,CAAC,CAAC,OAAO,CAA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,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<import("../types.js").InteractionType, (i: Discord.Interaction) => Handler<R, E>>;
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 {};
@@ -1,10 +1,10 @@
1
- import * as tsplus_module_1 from "dfx";
2
- import * as tsplus_module_2 from "@effect/io/Effect";
3
- import * as tsplus_module_3 from "@fp-ts/data/Option";
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
- [tsplus_module_1.Discord.InteractionType.PING]: () => tsplus_module_2.succeed({
27
- type: tsplus_module_1.Discord.InteractionCallbackType.PONG,
26
+ [Discord.InteractionType.PING]: () => Effect.succeed({
27
+ type: Discord.InteractionCallbackType.PONG,
28
28
  }),
29
- [tsplus_module_1.Discord.InteractionType.APPLICATION_COMMAND]: (i) => {
29
+ [Discord.InteractionType.APPLICATION_COMMAND]: (i) => {
30
30
  const data = i.data;
31
- return tsplus_module_4.pipe(tsplus_module_3.match(() => tsplus_module_2.fail(new DefinitionNotFound(i)), (command) => tsplus_module_2.isEffect(command.handle)
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))(tsplus_module_3.fromNullable(Commands[data.name])), (a) => a, tsplus_module_2.provideService(Ctx.ApplicationCommandContext)(data));
33
+ : command.handle(context))(Option.fromNullable(Commands[data.name])), (a) => a, Effect.provideService(Ctx.ApplicationCommandContext)(data));
34
34
  },
35
- [tsplus_module_1.Discord.InteractionType.MODAL_SUBMIT]: (i) => {
35
+ [Discord.InteractionType.MODAL_SUBMIT]: (i) => {
36
36
  const data = i.data;
37
- return tsplus_module_4.pipe(ModalSubmit, Arr.map((a) => tsplus_module_2.struct({
38
- command: tsplus_module_2.succeed(a),
37
+ return pipe(ModalSubmit, Arr.map((a) => Effect.struct({
38
+ command: Effect.succeed(a),
39
39
  match: a.predicate(data.custom_id),
40
- })), (a) => tsplus_module_2.flatMap((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new DefinitionNotFound(i)), (a) => a.command.handle)(tsplus_module_5.findFirst((a) => a.match)(a)))(tsplus_module_2.collectAllPar(a)), tsplus_module_2.provideService(Ctx.ModalSubmitContext)(data));
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
- [tsplus_module_1.Discord.InteractionType.MESSAGE_COMPONENT]: (i) => {
42
+ [Discord.InteractionType.MESSAGE_COMPONENT]: (i) => {
43
43
  const data = i.data;
44
- return tsplus_module_4.pipe(MessageComponent, Arr.map((a) => tsplus_module_2.struct({
45
- command: tsplus_module_2.succeed(a),
44
+ return pipe(MessageComponent, Arr.map((a) => Effect.struct({
45
+ command: Effect.succeed(a),
46
46
  match: a.predicate(data.custom_id),
47
- })), (a) => tsplus_module_2.flatMap((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new DefinitionNotFound(i)), (a) => a.command.handle)(tsplus_module_5.findFirst((a) => a.match)(a)))(tsplus_module_2.collectAllPar(a)), tsplus_module_2.provideService(Ctx.MessageComponentContext)(data));
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
- [tsplus_module_1.Discord.InteractionType.APPLICATION_COMMAND_AUTOCOMPLETE]: (i) => {
49
+ [Discord.InteractionType.APPLICATION_COMMAND_AUTOCOMPLETE]: (i) => {
50
50
  const data = i.data;
51
- return tsplus_module_3.getOrElse(() => tsplus_module_2.fail(new DefinitionNotFound(i)))(tsplus_module_3.map((focusedOption) => tsplus_module_4.pipe(Autocomplete, Arr.map((a) => tsplus_module_2.struct({
52
- command: tsplus_module_2.succeed(a),
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) => tsplus_module_2.flatMap((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new DefinitionNotFound(i)), (a) => a.command.handle)(tsplus_module_5.findFirst((a) => a.match)(a)))(tsplus_module_2.collectAllPar(a)), tsplus_module_2.provideService(Ctx.ApplicationCommandContext)(data), tsplus_module_2.provideService(Ctx.FocusedOptionContext)({ focusedOption })))(tsplus_module_1.IxHelpers.focusedOption(data)));
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":";;;;;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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AkB,CAAC,CAAC,CAAC,CAAC,EAxBlD,oBACA,CAAC,aAAa,EAAE,EAAE,CACrB,IAAI,CACF,YAAY,EACZ,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACZ,MAAM,CAAC,MAAM,CAAC;gBACZ,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC1B,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,aAAa,CAAC;aACxC,CAAC,CACH,EACD,CAAC,CAAC,EAAE,EAAE,CACJ,wBAAwB,CAAC,CAAC,EAAE,EAAE,CAC5B,sBAGI,GAAG,EAAE,CACH,MAAM,CAAC,IAAI,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAAkB,EACzD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAL3B,0BACa,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAD3B,CAAC,CAC2B,CAKzB,gCAPL,CAAC,EAQA,EACH,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,EAC1D,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CACnE,EAtBE,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAuBjC,CACuD,CAAA;QAC5D,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
@@ -1,9 +1,9 @@
1
- import { Effect } from "dfx/utils/common";
2
- import { DiscordREST, Discord } from "dfx";
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(): import("../utils/common.js").Effect<import("../index.js").DiscordREST, import("../index.js").FetchError | import("../index.js").StatusCodeError | import("../index.js").JsonParseError, import("../DiscordREST/types.js").ResponseWithData<import("../types.js").ApplicationCommand[]>>;
16
- syncGuild(appId: Discord.Snowflake, guildId: Discord.Snowflake): import("../utils/common.js").Effect<import("../index.js").DiscordREST, import("../index.js").FetchError | import("../index.js").StatusCodeError | import("../index.js").JsonParseError, import("../DiscordREST/types.js").ResponseWithData<import("../types.js").ApplicationCommand[]>>;
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) => import("../utils/common.js").Effect<never, never, boolean>;
20
- export declare const idStartsWith: (query: string) => (customId: string) => import("../utils/common.js").Effect<never, never, boolean>;
21
- export declare const idRegex: (query: RegExp) => (customId: string) => import("../utils/common.js").Effect<never, never, boolean>;
22
- export declare const option: (command: string, optionName: string) => (data: Pick<Discord.ApplicationCommandDatum, "name">, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) => import("../utils/common.js").Effect<never, never, boolean>;
23
- export declare const optionOnly: (optionName: string) => (_: unknown, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) => import("../utils/common.js").Effect<never, never, boolean>;
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>;
@@ -1,8 +1,9 @@
1
1
  import * as tsplus_module_1 from "@effect/io/Effect";
2
- import * as tsplus_module_2 from "dfx";
3
- export * from "./context.js";
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 tsplus_module_1.serviceWithEffect(tsplus_module_2.DiscordREST)((rest) => tsplus_module_1.flatMap((app) => rest.bulkOverwriteGlobalApplicationCommands(app.id, {
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 tsplus_module_1.serviceWithEffect(tsplus_module_2.DiscordREST)((rest) => rest.bulkOverwriteGuildApplicationCommands(appId, guildId, commands));
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) => tsplus_module_1.succeed(query === customId);
45
- export const idStartsWith = (query) => (customId) => tsplus_module_1.succeed(customId.startsWith(query));
46
- export const idRegex = (query) => (customId) => tsplus_module_1.succeed(query.test(customId));
47
- export const option = (command, optionName) => (data, focusedOption) => tsplus_module_1.succeed(data.name === command && focusedOption.name === optionName);
48
- export const optionOnly = (optionName) => (_, focusedOption) => tsplus_module_1.succeed(focusedOption.name === optionName);
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":";;AAEA,cAAc,cAAc,CAAA;AAE5B,OAAO,EACL,MAAM,EACN,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,YAAY,GAEb,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,QAAQ,IAAI,CAAC,EAAE,MAAM,4BAA4B,CAAA;AAE1D;;GAEG;AACH,MAAM,OAAO,kBAAkB;IACR;IAArB,YAAqB,WAA4C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