diff --git a/src/core/platform/strategy.ts b/src/core/platform/strategy.ts new file mode 100644 index 0000000..0ea7a7b --- /dev/null +++ b/src/core/platform/strategy.ts @@ -0,0 +1,22 @@ +enum DispatchType { + Websocket, + Serverless +} + + +type PlatformStrategy = + | WebsocketStrategy + | ServerlessStrategy; + +interface WebsocketStrategy { + type: DispatchType.Websocket; + interactionCreate: string; + messageCreate: string; + ready: string; + +} + +interface ServerlessStrategy { + type: DispatchType.Serverless; + +} diff --git a/src/core/structures/context.ts b/src/core/structures/context.ts new file mode 100644 index 0000000..becd643 --- /dev/null +++ b/src/core/structures/context.ts @@ -0,0 +1,18 @@ +import { Result as Either } from 'ts-results-es'; + + +export abstract class Context { + private constructor(private _: Either){} + + abstract get message(): Left; + abstract get interaction(): Right; + abstract get id(): string; + +} + +export function wrap( + val: Left|Right, + fa: (val: Left|Right +) => Either) { + return fa(val); +}