From ca34a6a090744687dc61bc346ea0bc26b86ed145 Mon Sep 17 00:00:00 2001 From: alexbcberio Date: Sun, 26 Dec 2021 01:12:22 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20Add=20types=20for=20act?= =?UTF-8?q?ions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/interfaces/actions/Action.ts | 7 +++++++ src/interfaces/actions/BroadcastAction.ts | 8 ++++++++ src/interfaces/actions/SayAction.ts | 8 ++++++++ src/interfaces/actions/TimeoutAction.ts | 10 ++++++++++ src/interfaces/actions/VipAction.ts | 6 ++++++ 5 files changed, 39 insertions(+) create mode 100644 src/interfaces/actions/Action.ts create mode 100644 src/interfaces/actions/BroadcastAction.ts create mode 100644 src/interfaces/actions/SayAction.ts create mode 100644 src/interfaces/actions/TimeoutAction.ts create mode 100644 src/interfaces/actions/VipAction.ts diff --git a/src/interfaces/actions/Action.ts b/src/interfaces/actions/Action.ts new file mode 100644 index 0000000..69731df --- /dev/null +++ b/src/interfaces/actions/Action.ts @@ -0,0 +1,7 @@ +export interface Action { + type: string; + channelId: string; + userId: string; + scheduledAt?: number; + data: any; +} \ No newline at end of file diff --git a/src/interfaces/actions/BroadcastAction.ts b/src/interfaces/actions/BroadcastAction.ts new file mode 100644 index 0000000..d125036 --- /dev/null +++ b/src/interfaces/actions/BroadcastAction.ts @@ -0,0 +1,8 @@ +import { Action } from "./Action"; + +export interface BroadcastAction extends Action { + type: "broadcast"; + data: { + message: string; + } +} \ No newline at end of file diff --git a/src/interfaces/actions/SayAction.ts b/src/interfaces/actions/SayAction.ts new file mode 100644 index 0000000..37b637b --- /dev/null +++ b/src/interfaces/actions/SayAction.ts @@ -0,0 +1,8 @@ +import { Action } from "./Action"; + +export interface SayAction extends Action { + type: "say"; + data: { + message: "string"; + } +} \ No newline at end of file diff --git a/src/interfaces/actions/TimeoutAction.ts b/src/interfaces/actions/TimeoutAction.ts new file mode 100644 index 0000000..d404ce5 --- /dev/null +++ b/src/interfaces/actions/TimeoutAction.ts @@ -0,0 +1,10 @@ +import { Action } from "./Action"; + +export interface TimeoutAction extends Action { + type: "timeout"; + data: { + username: string; + time: number; + reason?: string; + } +} \ No newline at end of file diff --git a/src/interfaces/actions/VipAction.ts b/src/interfaces/actions/VipAction.ts new file mode 100644 index 0000000..a529fa0 --- /dev/null +++ b/src/interfaces/actions/VipAction.ts @@ -0,0 +1,6 @@ +import { Action } from "./Action"; + +export interface VipAction extends Action { + type: "addVip" | "removeVip"; + data: undefined; +} \ No newline at end of file