feat: add changes to sync with latest changes (#9)

Latest changes come from -> https://github.com/sern-handler/handler/pull/64
This commit is contained in:
Jacob Nguyen
2022-07-01 12:56:25 -05:00
committed by GitHub
parent 6cfaff341c
commit cbfb455407
6 changed files with 20 additions and 20 deletions

View File

@@ -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"

View File

@@ -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 🏓');
},
});

View File

@@ -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();

View File

@@ -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",

View File

@@ -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 🏓' });
},
});

View File

@@ -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();