From cbfb45540732fcba34e69f67e7541e5cb2d440b8 Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Fri, 1 Jul 2022 12:56:25 -0500 Subject: [PATCH] feat: add changes to sync with latest changes (#9) Latest changes come from -> https://github.com/sern-handler/handler/pull/64 --- templates/javascript/package.json | 8 +++----- templates/javascript/src/commands/ping.js | 9 +++++---- templates/javascript/src/index.js | 3 ++- templates/typescript/package.json | 8 +++----- templates/typescript/src/commands/ping.ts | 9 +++++---- templates/typescript/src/index.ts | 3 ++- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/templates/javascript/package.json b/templates/javascript/package.json index a509366..b47aa81 100644 --- a/templates/javascript/package.json +++ b/templates/javascript/package.json @@ -9,14 +9,12 @@ "keywords": [ "javacsript", "sern", - "discord.js", - "cli" + "discord.js" ], - "author": "EvolutionX", "license": "UNLICENSED", "dependencies": { - "@sern/handler": "^1.0.1-beta", - "discord.js": "^14.0.0-dev.1650672498-3617093" + "@sern/handler": "^1.1.0-beta", + "discord.js": "^14.0.0-dev.1654776344-94bdcac" }, "devDependencies": { "@types/node": "^17.0.25" diff --git a/templates/javascript/src/commands/ping.js b/templates/javascript/src/commands/ping.js index 20f6b81..8e7be84 100644 --- a/templates/javascript/src/commands/ping.js +++ b/templates/javascript/src/commands/ping.js @@ -1,10 +1,11 @@ -const { CommandType, sernModule } = require('@sern/handler'); +const { CommandType, commandModule } = require('@sern/handler'); -exports.default = sernModule([], { +exports.default = commandModule({ type: CommandType.Both, + plugins: [], description: 'A ping command', //alias : [], - execute: (ctx, args) => { - ctx.reply({ content: 'Pong 🏓' }); + execute: async (ctx, args) => { + await ctx.reply('Pong 🏓'); }, }); diff --git a/templates/javascript/src/index.js b/templates/javascript/src/index.js index 05d1d6a..49fc280 100644 --- a/templates/javascript/src/index.js +++ b/templates/javascript/src/index.js @@ -9,11 +9,12 @@ const client = new Client({ GatewayIntentBits.MessageContent, // Make sure this is enabled for text commands! ], }); - +//View docs for all options Sern.init({ client, defaultPrefix: '!', // removing defaultPrefix will shut down text commands commands: 'src/commands', + events: '', // join discord server to learn how to load events! }); client.login(); diff --git a/templates/typescript/package.json b/templates/typescript/package.json index e931ee1..448f649 100644 --- a/templates/typescript/package.json +++ b/templates/typescript/package.json @@ -9,14 +9,12 @@ "keywords": [ "typescript", "sern", - "discord.js", - "cli" + "discord.js" ], - "author": "EvolutionX", "license": "UNLICENSED", "dependencies": { - "@sern/handler": "^1.0.1-beta", - "discord.js": "^14.0.0-dev.1650672498-3617093" + "@sern/handler": "^1.1.0-beta", + "discord.js": "^14.0.0-dev.1654776344-94bdcac" }, "devDependencies": { "@types/node": "^17.0.25", diff --git a/templates/typescript/src/commands/ping.ts b/templates/typescript/src/commands/ping.ts index 38edbf2..a65644f 100644 --- a/templates/typescript/src/commands/ping.ts +++ b/templates/typescript/src/commands/ping.ts @@ -1,10 +1,11 @@ -import { Args, CommandType, Context, sernModule } from '@sern/handler'; +import { commandModule, CommandType } from '@sern/handler'; -export default sernModule([], { +export default commandModule({ type: CommandType.Both, + plugins: [], description: 'A ping command', //alias : [], - execute: (ctx: Context, args: Args) => { - ctx.reply({ content: 'Pong 🏓' }); + execute: async (ctx, args) => { + await ctx.reply({ content: 'Pong 🏓' }); }, }); diff --git a/templates/typescript/src/index.ts b/templates/typescript/src/index.ts index 9700bc9..ee7720f 100644 --- a/templates/typescript/src/index.ts +++ b/templates/typescript/src/index.ts @@ -9,11 +9,12 @@ const client = new Client({ GatewayIntentBits.MessageContent, //Make sure this is enabled for text commands! ], }); - +//View docs for all options Sern.init({ client, defaultPrefix: '!', // removing defaultPrefix will shut down text commands commands: 'dist/commands', + events: '', // join discord server to learn how to load events! }); client.login();