Skip to content
This repository has been archived by the owner on Nov 19, 2017. It is now read-only.

Commit

Permalink
Switch around arguments for tags
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed May 2, 2017
1 parent 2d13bc6 commit bda4049
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions commands/tags/add-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ module.exports = class ExampleAddCommand extends Command {
}

async run(msg, args) {
const name = Util.cleanContent(args.name.toLowerCase(), msg);
const content = Util.cleanContent(args.content, msg);
const name = Util.cleanContent(msg, args.name.toLowerCase());
const content = Util.cleanContent(msg, args.content);
const tag = await Tag.findOne({ where: { name, guildID: msg.guild.id } });
if (tag) return msg.say(`An example with the name **${name}** already exists, ${msg.author}`);

Expand All @@ -54,8 +54,8 @@ module.exports = class ExampleAddCommand extends Command {
guildName: msg.guild.name,
channelID: msg.channel.id,
channelName: msg.channel.name,
name: name,
content: content,
name,
content,
type: true,
example: true
});
Expand Down
8 changes: 4 additions & 4 deletions commands/tags/add-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ module.exports = class ServerTagAddCommand extends Command {
}

async run(msg, args) {
const name = Util.cleanContent(args.name.toLowerCase(), msg);
const content = Util.cleanContent(args.content, msg);
const name = Util.cleanContent(msg, args.name.toLowerCase());
const content = Util.cleanContent(msg, args.content);
const tag = await Tag.findOne({ where: { name, guildID: msg.guild.id } });
if (tag) return msg.say(`A server tag with the name **${name}** already exists, ${msg.author}`);

Expand All @@ -53,8 +53,8 @@ module.exports = class ServerTagAddCommand extends Command {
guildName: msg.guild.name,
channelID: msg.channel.id,
channelName: msg.channel.name,
name: name,
content: content,
name,
content,
type: true
});

Expand Down
8 changes: 4 additions & 4 deletions commands/tags/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ module.exports = class TagAddCommand extends Command {
}

async run(msg, args) {
const name = Util.cleanContent(args.name.toLowerCase(), msg);
const content = Util.cleanContent(args.content, msg);
const name = Util.cleanContent(msg, args.name.toLowerCase());
const content = Util.cleanContent(msg, args.content);
const tag = await Tag.findOne({ where: { name, guildID: msg.guild.id } });
if (tag) return msg.say(`A tag with the name **${name}** already exists, ${msg.author}`);

Expand All @@ -49,8 +49,8 @@ module.exports = class TagAddCommand extends Command {
guildName: msg.guild.name,
channelID: msg.channel.id,
channelName: msg.channel.name,
name: name,
content: content
name,
content
});

return msg.say(`A tag with the name **${name}** has been added, ${msg.author}`);
Expand Down
2 changes: 1 addition & 1 deletion util/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Util {
throw new Error(`The ${this.constructor.name} class may not be instantiated.`);
}

static cleanContent(content, msg) {
static cleanContent(msg, content) {
return content.replace(/@everyone/g, '@\u200Beveryone')
.replace(/@here/g, '@\u200Bhere')
.replace(/<@&[0-9]+>/g, roles => {
Expand Down

0 comments on commit bda4049

Please sign in to comment.