Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

Commit

Permalink
New line at end of file
Browse files Browse the repository at this point in the history
Enforcing .editorconfig insert_final_newline = true - files should end on new line.

Added lint rule as well.

Some other minor code cleanup.
  • Loading branch information
abyss committed Apr 22, 2017
1 parent 6473ef1 commit 8fab322
Show file tree
Hide file tree
Showing 56 changed files with 71 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
trim_trailing_whitespace = false
6 changes: 5 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
],
"no-var": [
"warn"
],
"eol-last": [
"warn",
"always"
]
}
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ node_modules/
data/
*.sqlite
src/config.json
/config.json
/config.json
2 changes: 1 addition & 1 deletion Install.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cd %~dp0
yarn install
pause
pause
2 changes: 1 addition & 1 deletion Run.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cd %~dp0
yarn start
pause
pause
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ gulp.task('default', ['main', 'watch']);

process.on('exit', () => {
if (bot) bot.kill();
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"figlet": "^1.2.0",
"fs-extra": "^2.1.2",
"giphy": "^0.0.4",
"giphy-api": "^1.2.5",
"giphy-api": "^1.2.5",
"google-translate-api": "abyssvi/google-translate-api",
"got": "^6.7.1",
"leven": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ process.on('unhandledRejection', err => {
logger.severe('Uncaught Promise error: \n' + err.stack);
});

config && bot.login(config.botToken);
config && bot.login(config.botToken);
2 changes: 1 addition & 1 deletion src/commands/Fun/anim.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ exports.info = {
name: 'anim',
usage: 'anim [-d <delay>] <emoji> [emoji2] [...]',
description: '"Animates" a series of emojis'
};
};
2 changes: 1 addition & 1 deletion src/commands/Fun/binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ exports.info = {
name: 'binary',
usage: 'binary <encode|decode> <input>',
description: 'Encodes/decodes your input to/from binary'
};
};
2 changes: 1 addition & 1 deletion src/commands/Fun/binex.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ exports.info = {
name: 'binex',
usage: 'binex <num1> <num2>',
description: 'Explains binary crap'
};
};
2 changes: 1 addition & 1 deletion src/commands/Fun/cat.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ exports.info = {
name: 'cat',
usage: 'cat',
description: 'Shows you pictures of random cats'
};
};
2 changes: 1 addition & 1 deletion src/commands/Fun/dog.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ exports.info = {
name: 'dog',
usage: 'dog',
description: 'Shows you pictures of random dogs'
};
};
2 changes: 1 addition & 1 deletion src/commands/Fun/fanceh.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ exports.info = {
name: 'fanceh',
usage: 'fanceh <text>',
description: 'Renders text in big emoji letters'
};
};
2 changes: 1 addition & 1 deletion src/commands/Fun/figlet.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ exports.info = {
name: 'figlet',
usage: 'figlet <text>',
description: 'Renders fancy ASCII text'
};
};
2 changes: 1 addition & 1 deletion src/commands/Fun/gif.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let giphy = require('giphy-api')();
const giphy = require('giphy-api')();

exports.run = (bot, msg, args) => {
if (args.length < 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/Fun/meme.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ exports.info = {
'meme facepalm | please, oh please | rtfm',
'meme sad-biden | sad joe biden | doesn\'t have discord | scowl'
]
};
};
2 changes: 1 addition & 1 deletion src/commands/Fun/reverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ exports.info = {
name: 'reverse',
usage: 'reverse <text>',
description: 'Reverses the text you input'
};
};
4 changes: 2 additions & 2 deletions src/commands/Fun/roll.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let Roll = require('roll');
let roller = new Roll();
const Roll = require('roll');
const roller = new Roll();
const RichEmbed = require('discord.js').RichEmbed;

exports.run = function (bot, msg, args) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/Fun/shoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ exports.info = {
name: 'shoot',
usage: 'shoot <user>',
description: 'Shoots yer friendz!'
};
};
2 changes: 1 addition & 1 deletion src/commands/Fun/sigh.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ exports.info = {
name: 'sigh',
usage: 'sigh',
description: 'Dramatic sigh text'
};
};
5 changes: 4 additions & 1 deletion src/commands/Fun/space.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ exports.run = (bot, msg, args) => {
if (args.length < 1) {
throw 'You must provide text to space out!';
}

let amount = 2;

if (!isNaN(args[0])) {
amount = parseInt(args[0]);
(amount < 1) && (amount = 1);
(amount > 15) && (amount = 15);
args = args.slice(1);
}

msg.edit(args.join(' '.repeat(amount / 2)).split('').join(' '.repeat(amount)));
};

exports.info = {
name: 'space',
usage: 'space [amount] <text>',
description: 'Spaces out text to look all dramatic n\' stuff'
};
};
2 changes: 1 addition & 1 deletion src/commands/Fun/xkcd.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ exports.info = {
name: 'xkcd',
usage: 'xkcd',
description: 'Shows you random xkcd comics'
};
};
2 changes: 1 addition & 1 deletion src/commands/Info/guilds.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ exports.info = {
name: 'guilds',
usage: 'guilds',
description: 'Lists all guilds that you\'re a member of'
};
};
4 changes: 2 additions & 2 deletions src/commands/Info/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ exports.run = (bot, msg, args) => {
bot.utils.embed(title, stripIndents`
**Available categories:**
${categories.map(c => `- __${c}__`).join('\n')}
**Usage:**
Do \`${bot.config.prefix}help category <name>\` for a list of commands in a specific category.
Do \`${bot.config.prefix}help all\` for a list of every command available in this bot.
Expand Down Expand Up @@ -106,4 +106,4 @@ exports.info = {
name: 'help',
usage: 'help all|[command]|[category <name>]',
description: 'Shows you help for all commands or just a single command'
};
};
2 changes: 1 addition & 1 deletion src/commands/Info/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ exports.info = {
name: 'stats',
usage: 'stats',
description: 'Shows you stats about SharpBot'
};
};
2 changes: 1 addition & 1 deletion src/commands/Info/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ exports.info = {
name: 'users',
usage: 'users',
description: 'Lists all users on your current server'
};
};
2 changes: 1 addition & 1 deletion src/commands/Moderation/flush.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ exports.info = {
name: 'flush',
usage: 'flush <amount>',
description: 'Deletes messages sent by bots'
};
};
2 changes: 1 addition & 1 deletion src/commands/Moderation/prune.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ exports.info = {
name: 'prune',
usage: 'prune [amount]',
description: 'Deletes a certain number of messages sent by you'
};
};
2 changes: 1 addition & 1 deletion src/commands/Moderation/purge.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ exports.info = {
name: 'purge',
usage: 'purge [amount]',
description: 'Deletes a certain number of messages'
};
};
2 changes: 1 addition & 1 deletion src/commands/Moderation/quote.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ exports.info = {
name: 'quote',
usage: 'quote <id>',
description: 'Quotes the message with the given ID'
};
};
2 changes: 1 addition & 1 deletion src/commands/Moderation/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ exports.info = {
name: 'search',
usage: 'search <#> <text>',
description: 'Searches a number of messages for some text'
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/Tags/tag-add.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ exports.info = {
name: 'addtag',
usage: 'addtag <tag> <text>',
description: 'Adds a tag'
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/Tags/tag-delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ exports.info = {
name: 'deltag',
usage: 'deltag <tag>',
description: 'Deletes a saved tag'
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/Tags/tag-get.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ exports.info = {
name: 'tag',
usage: 'tag <tag>',
description: 'Displays a saved tag'
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/Tags/tag-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ exports.info = {
name: 'tags',
usage: 'tags [add|delete] [id]',
description: 'Lists all saved tags'
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ exports.info = {
description: 'Sets the author of the embed'
}
]
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ exports.info = {
description: 'Sets the output code-block syntax language'
}
]
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ exports.info = {
name: 'exec',
usage: 'exec [-l <lang>] <command>',
description: 'Executes a command in the console'
};
};
4 changes: 2 additions & 2 deletions src/commands/Utility/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function getInfo(json) {
\t**Description:** _${json.description || 'None provided'}_
\t**Owner:** [${json.owner.login}](${json.owner.html_url})
\t**Primary Language:** \`${json.language}\`
\t**Primary Language:** \`${json.language}\`
\t:house: [Home page](${json.html_url}) :small_red_triangle_down: [Downloads](${json.html_url}/releases) :exclamation: [Issues](${json.html_url}/issues)
Expand All @@ -77,4 +77,4 @@ exports.info = {
name: 'github',
usage: 'github user/repo',
description: 'Links to a GitHub repository'
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/google.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ exports.info = {
name: 'google',
usage: 'google <search>',
description: 'Searches Google using magic'
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/haste.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ exports.info = {
name: 'haste',
usage: 'haste [-r|--raw] <text>',
description: 'Uploads some text to Hastebin'
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/lmgtfy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ exports.info = {
description: 'Enables Internet Explainer'
}
]
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ exports.info = {
name: 'ping',
usage: 'ping',
description: 'Pings the bot'
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/restart.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ exports.info = {
name: 'restart',
usage: 'restart',
description: 'Restarts the bot'
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/setgame.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ exports.info = {
description: 'Sets your streaming URL to http://twitch.tv/<url>'
}
]
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ exports.info = {
name: 'shortcuts',
usage: 'shortcuts [add|delete] [id]',
description: 'Controls or lists your shortcuts'
};
};
2 changes: 1 addition & 1 deletion src/commands/Utility/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ exports.info = {
description: 'Sets the `from` language, this is `auto` by default'
}
]
};
};
2 changes: 1 addition & 1 deletion src/commands/_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ exports.info = {
name: '',
usage: '',
description: ''
};
};
4 changes: 2 additions & 2 deletions src/managers/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CommandManager {
this._commands = [];
this._categories = [];

let bot = this.bot;
const bot = this.bot;

read.fileSync(folder).forEach(file => {
file = file.substr(folder.length + 1);
Expand Down Expand Up @@ -86,4 +86,4 @@ class CommandManager {

}

module.exports = CommandManager;
module.exports = CommandManager;
Loading

0 comments on commit 8fab322

Please sign in to comment.