From 59dc1f55f6e172902e3ba0ca61b4e20ae31db3bb Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Sun, 13 Feb 2022 16:42:13 -0600 Subject: [PATCH 1/3] Update basic usage --- README.md | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9b339e0..9285a82 100644 --- a/README.md +++ b/README.md @@ -16,18 +16,33 @@ yarn add sern-handler # Basic Usage -```js - import { Sern, PayloadOptions } from 'sern-handler'; +```ts +const client = new Client({ + intents: [ + Intents.FLAGS.GUILDS, + Intents.FLAGS.GUILD_MESSAGES, + Intents.FLAGS.GUILD_MEMBERS + ] - const payload = new PayloadOptions({ - commands: '/commands', // Folder where all commands are located (subfolders supported). - events: '/events' // Events folder directory (subfolders supported). - owners: ['182326315813306369'], // Array of Discord ID(s). - prefix: '/', // Prefix for your bot (if no provied then it will use /). - client // The instance of Discord#Client(). - }); +}) - const handler = new Sern(payload); // Create a new instance of Sern with payloads. + new Sern.Handler( { + client, + prefix, + commands : "dist/commands", + privateServers : [ + { + test : true, + id: "server id" + } + ], + init: async (handler : Sern.Handler) => { + /* an optional function to initialize anything else on bot startup */ + }, +}); + + +client.login(token) ``` # Links From 1ae6ae86facb64c9bc9924e058db2447da249dec Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Sun, 13 Feb 2022 20:26:15 -0600 Subject: [PATCH 2/3] update readme.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 9285a82..f4dd48f 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,13 @@ yarn add sern-handler # Basic Usage +[Typescript](https://www.typescriptlang.org/) ```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, From 8348c95dd40437cbe8ba22a801345a9df2a7482b Mon Sep 17 00:00:00 2001 From: EvolutionX Date: Mon, 14 Feb 2022 09:27:31 +0530 Subject: [PATCH 3/3] updated package-lock.json to match package.json --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 474cf64..41b0c4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "sernhandler2", + "name": "sern-handler", "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "sernhandler2", + "name": "sern-handler", "version": "1.0.0", "license": "ISC", "dependencies": {