From 6a983a5eaed32da234eca03ba0381514be1d2223 Mon Sep 17 00:00:00 2001 From: xxDeveloper <77380166+Murtatrxx@users.noreply.github.com> Date: Wed, 15 Jun 2022 23:43:22 +0300 Subject: [PATCH] style: Improved plugin.ts comments --- src/handler/plugins/plugin.ts | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/handler/plugins/plugin.ts b/src/handler/plugins/plugin.ts index 387eb8f..3199c51 100644 --- a/src/handler/plugins/plugin.ts +++ b/src/handler/plugins/plugin.ts @@ -1,15 +1,15 @@ -// -// Plugins can be inserted on all commands and are emitted -// -// 1. on ready event, where all commands are loaded. -// 2. on corresponding observable (command triggers) -// -// The goal of plugins is to organize commands and -// provide extensions to repetitive patterns -// examples include refreshing modules, -// categorizing commands, cooldowns, permissions, etc. -// Plugins are reminiscent of middleware in express. -// +/* + * Plugins can be inserted on all commands and are emitted + * + * 1. on ready event, where all commands are loaded. + * 2. on corresponding observable (command triggers) + * + * The goal of plugins is to organize commands and + * provide extensions to repetitive patterns + * examples include refreshing modules, + * categorizing commands, cooldowns, permissions, etc. + * Plugins are reminiscent of middleware in express. +*/ import type { Awaitable, Client } from 'discord.js'; import type { Err, Ok, Result } from 'ts-results'; @@ -56,7 +56,7 @@ export type EventPlugin = { >; }[T]; -//Syntactic sugar on hold +// Syntactic sugar on hold // export function plugins( // ...plug: (EventPlugin | CommandPlugin)[] // ) { @@ -77,7 +77,8 @@ function isCommandPlugin( ): e is CommandPlugin { return !isEventPlugin(e); } -//TODO: I WANT BETTER TYPINGS AHHHHHHHHHHHHHHH + +// TODO: Do better typings export function sernModule( plugin: (CommandPlugin | EventPlugin)[], mod: ModuleNoPlugins[T],