From 499a996a6c0e0576415ef90237c6f9f6ef1cd22d Mon Sep 17 00:00:00 2001 From: jacoobes Date: Mon, 14 Feb 2022 09:59:28 -0600 Subject: [PATCH] readme changes --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index 3263ce7..3cc05e5 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,38 @@ yarn add sern-handler # Basic Usage +Typescript +```ts +import { Client } from 'discord.js' +import { Intents } from 'discord.js' +import { prefix, token } from "../src/secrets.json" +import { Sern } from "sern-handler" + +const client = new Client({ + intents: [ + Intents.FLAGS.GUILDS, + Intents.FLAGS.GUILD_MESSAGES, + Intents.FLAGS.GUILD_MEMBERS + ] + +}) + + new Sern.Handler( { + client, + prefix, + commands : 'dist/commands', + privateServers : [ + { + test : true, + id: 'server-id' + } + ], + init: async (handler : Sern.Handler) => { + // Optional function to initialize anything else on bot startup + }, +}); +``` + JavaScript ```js import { Client, Intents } from 'discord.js';