Last active
January 16, 2017 18:22
-
-
Save Hakej/0b65b9f8df2bb424d868afaca7cf25bb to your computer and use it in GitHub Desktop.
"node --harmony ." doesn't work. The error I get is put in the comment of index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const commando = require('discord.js-commando'); | |
class DiceRollCommand extends commando.Command { | |
contructor(client) { | |
super(client, { | |
name: 'roll', | |
group: 'random', | |
memberName: 'roll', | |
description: 'Rolls a dice' | |
}); | |
} | |
async run(message, args) { | |
var roll = Math.floor(Math.random() * 6) + 1; | |
message.reply("You rolled a " + roll); | |
} | |
} | |
module.exports = DiceRollCommand; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const commando = require('discord.js-commando'); | |
const bot = new commando.Client(); | |
bot.registry.registerGroup('random', 'Random'); | |
bot.registry.registerDefaults(); | |
bot.registry.registerCommandsIn(__dirname + "/commands"); | |
bot.login('mybotnodehere'); | |
/* | |
C:\Users\Hakej\Desktop\Mizin Bot\commands\random\dice_roll.js:5 | |
super(client, { | |
^^^^^ | |
SyntaxError: 'super' keyword unexpected here | |
at Object.exports.runInThisContext (vm.js:78:16) | |
at Module._compile (module.js:543:28) | |
at Object.Module._extensions..js (module.js:580:10) | |
at Module.load (module.js:488:32) | |
at tryModuleLoad (module.js:447:12) | |
at Function.Module._load (module.js:439:3) | |
at require (internal/module.js:20:19) | |
at C:\Users\Hakej\Desktop\Mizin Bot\node_modules\require-all\index.js:52:46 | |
at Array.forEach (native) | |
at requireAll (C:\Users\Hakej\Desktop\Mizin Bot\node_modules\require-all\index.js:34:9) | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment