From 63b2d3a5723ac6e1f0baa0de8b65640cecd7d634 Mon Sep 17 00:00:00 2001 From: jacoobes Date: Tue, 15 Feb 2022 13:44:04 -0600 Subject: [PATCH] feat(readme.md): added basic command examples #TODO --- README.md | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5699fb5..fb36dca 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ pnpm add sern-handler ## Basic Usage -##### [Typescript](https://www.typescriptlang.org/) +#### [Typescript](https://www.typescriptlang.org/) ```ts import { Client, Intents } from 'discord.js' import { Sern } from 'sern-handler'; @@ -49,8 +49,23 @@ new Sern.Handler({ }, }); ``` +#### `ping.ts` +```ts +import { Sern, Types } from "sern-handler"; +import { Ok } from "ts-results"; -##### [JavaScript](https://www.javascript.com) +export default { + alias: [], + desc : "ping pong", + visibility : "private", + test : false, + type: Sern.CommandType.SLASH | Sern.CommandType.TEXT, + execute : async ({message, interaction} : Types.Context, args: Ok ) => Ok("pong!") + +} as Sern.Module; +``` + +#### [JavaScript](https://www.javascript.com) ```js import { Client, Intents } from 'discord.js'; import { Sern } from 'sern-handler'; @@ -82,6 +97,21 @@ new Sern.Handler({ client.login(token); ``` +#### `ping.js` +```js +import { Sern, Types } from "sern-handler"; +import { Ok } from "ts-results"; + +export default { + alias: [], + desc : "ping pong", + visibility : "private", + test : false, + type: Sern.CommandType.SLASH | Sern.CommandType.TEXT, + execute : async ({message, interaction}, args) => Ok("pong!") + +}; +``` ## Links ![link](https://img.shields.io/badge/Coming-Soon-purple)