formatting fixes
This commit is contained in:
parent
33219cb3f1
commit
41c3b51ed6
7 changed files with 144 additions and 148 deletions
|
@ -1,11 +1,11 @@
|
||||||
const Command = require("../../base/Command.js");
|
const Command = require('../../base/Command.js');
|
||||||
|
|
||||||
class Help extends Command {
|
class Help extends Command {
|
||||||
constructor (client) {
|
constructor (client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
description: "Lists what commands Woomy has, what they do, and how to use them.",
|
description: 'Lists what commands Woomy has, what they do, and how to use them.',
|
||||||
usage: "'`help` - Lists all commands.\n`help <command>` - Shows detailed information on a specific command.'",
|
usage: '`help` - Lists all commands.\n`help <command>` - Shows detailed information on a specific command.',
|
||||||
aliases: ["cmds"],
|
aliases: ['cmds'],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
const Command = require("../../base/Command.js");
|
const Command = require('../../base/Command.js');
|
||||||
|
|
||||||
class Ping extends Command {
|
class Ping extends Command {
|
||||||
constructor (client) {
|
constructor (client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
description: "Latency and API response times.",
|
description: 'Latency and API response times.',
|
||||||
usage: "ping",
|
usage: 'ping',
|
||||||
aliases: ["pong"]
|
aliases: ['pong']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async run (message, args, data) { // eslint-disable-line no-unused-vars
|
async run (message, args, data) { // eslint-disable-line no-unused-vars
|
||||||
try {
|
try {
|
||||||
const msg = await message.channel.send('Pinging...')
|
const msg = await message.channel.send('Pinging...');
|
||||||
msg.edit(
|
msg.edit(
|
||||||
`Pong! \`${msg.createdTimestamp - message.createdTimestamp}ms\` (💗 \`${Math.round(this.client.ws.ping)}ms\`)`
|
`Pong! \`${msg.createdTimestamp - message.createdTimestamp}ms\` (💗 \`${Math.round(this.client.ws.ping)}ms\`)`
|
||||||
)
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.client.logger.err(err)
|
this.client.logger.err(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,33 +1,34 @@
|
||||||
const Command = require("../../base/Command.js");
|
const Command = require('../../base/Command.js');
|
||||||
const Discord = require("discord.js");
|
const Discord = require('discord.js');
|
||||||
|
|
||||||
class Eval extends Command {
|
class Eval extends Command {
|
||||||
constructor (client) {
|
constructor (client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
description: "Evaluates arbitrary Javascript.",
|
description: 'Evaluates arbitrary Javascript.',
|
||||||
usage: "eval <expression>",
|
usage: 'eval <expression>',
|
||||||
aliases: ["ev"],
|
aliases: ['ev'],
|
||||||
permLevel: "Bot Owner",
|
permLevel: 'Bot Owner',
|
||||||
devOnly: true
|
devOnly: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async run (message, args, data) { // eslint-disable-line no-unused-vars
|
async run (message, args, data) { // eslint-disable-line no-unused-vars
|
||||||
const code = args.join(" ");
|
const code = args.join(' ');
|
||||||
try {
|
try {
|
||||||
const evaled = eval(code);
|
const evaled = eval(code);
|
||||||
const clean = await this.client.functions.clean(evaled);
|
const clean = await this.client.functions.clean(evaled);
|
||||||
const MAX_CHARS = 3 + 2 + clean.length + 3;
|
const MAX_CHARS = 3 + 2 + clean.length + 3;
|
||||||
if (MAX_CHARS > 2000) {
|
if (MAX_CHARS > 2000) {
|
||||||
message.channel.send({ files: [new Discord.MessageAttachment(Buffer.from(clean), "output.txt")] });
|
message.channel.send({ files: [new Discord.MessageAttachment(Buffer.from(clean), 'output.txt')] });
|
||||||
}
|
}
|
||||||
message.channel.send(`\`\`\`js\n${clean}\n\`\`\``);
|
message.channel.send(`\`\`\`js\n${clean}\n\`\`\``);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const e = await this.client.functions.clean(err);
|
const e = await this.client.functions.clean(err);
|
||||||
const MAX_CHARS = 1 + 5 + 1 + 3 + e.length + 3;
|
const MAX_CHARS = 1 + 5 + 1 + 3 + e.length + 3;
|
||||||
if (MAX_CHARS > 2000) {
|
if (MAX_CHARS > 2000) {
|
||||||
return message.channel.send({ files: [new Discord.MessageAttachment(Buffer.from(e), "error.txt")] });
|
return message.channel.send({ files: [new Discord.MessageAttachment(Buffer.from(e), 'error.txt')] });
|
||||||
}
|
}
|
||||||
|
|
||||||
message.channel.send(`\`ERROR\` \`\`\`xl\n${e}\n\`\`\``);
|
message.channel.send(`\`ERROR\` \`\`\`xl\n${e}\n\`\`\``);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
const Command = require("../../base/Command.js");
|
const Command = require('../../base/Command.js');
|
||||||
|
|
||||||
class Lastmessage extends Command {
|
class Lastmessage extends Command {
|
||||||
constructor (client) {
|
constructor (client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
description: "Grab last message sent to a channel.",
|
description: 'Grab last message sent to a channel.',
|
||||||
usage: "lastmessage",
|
usage: 'lastmessage',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,38 +1,33 @@
|
||||||
const Command = require("../../base/Command.js");
|
const Command = require('../../base/Command.js');
|
||||||
|
|
||||||
class Msearch extends Command {
|
class Msearch extends Command {
|
||||||
constructor (client) {
|
constructor (client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
description: "Lists all members found that match the input",
|
description: 'Lists all members found that match the input',
|
||||||
usage: "`msearch` [query] - Finds users in this server that match the query.`",
|
usage: '`msearch` [query] - Finds users in this server that match the query.`',
|
||||||
aliases: ['membersearch']
|
aliases: ['membersearch']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async run (message, args, data) { // eslint-disable-line no-unused-vars
|
async run (message, args, data) { // eslint-disable-line no-unused-vars
|
||||||
if (!args[0])
|
if (!args[0]) return message.channel.send('No username provided.');
|
||||||
return message.channel.send(
|
|
||||||
`No username provided.`
|
|
||||||
);
|
|
||||||
|
|
||||||
var mlist = "";
|
let mlist = '';
|
||||||
var count = 0;
|
let count = 0;
|
||||||
|
|
||||||
this.client.functions.searchForMembers(message.guild, args[0]).forEach((member) => {
|
this.client.functions.searchForMembers(message.guild, args[0]).forEach((member) => {
|
||||||
if (member) {
|
if (member) {
|
||||||
mlist += `\`${member.user.tag}\``;
|
mlist += `\`${member.user.tag}\``;
|
||||||
count = count + 1;
|
count = count + 1;
|
||||||
}
|
}
|
||||||
mlist += "**, **";
|
mlist += '**, **';
|
||||||
});
|
});
|
||||||
|
|
||||||
mlist = mlist.substring(0, mlist.length - 6);
|
mlist = mlist.substring(0, mlist.length - 6);
|
||||||
|
|
||||||
var mlist1 = `Found ${count} users:\n` + mlist;
|
const mlist1 = `Found ${count} users:\n` + mlist;
|
||||||
|
|
||||||
if (!mlist1) {
|
if (!mlist1) return message.channel.send('No users found!');
|
||||||
return message.channel.send("No users found!");
|
|
||||||
};
|
|
||||||
|
|
||||||
message.channel.send(mlist1);
|
message.channel.send(mlist1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
const Discord = require('discord.js');
|
const Discord = require('discord.js');
|
||||||
const Command = require("../../base/Command.js");
|
const Command = require('../../base/Command.js');
|
||||||
|
|
||||||
class Avatar extends Command {
|
class Avatar extends Command {
|
||||||
constructor (client) {
|
constructor (client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
description: "View a full-sized image of a person's profile picture.",
|
description: 'View a full-sized image of a person\'s profile picture.',
|
||||||
usage: "avatar <user>",
|
usage: 'avatar <user>',
|
||||||
examples: "`avatar` - Gets your avatar.\n`avatar emily` - Gets the avatar of the user 'emily' ",
|
examples: '`avatar` - Gets your avatar.\n`avatar emily` - Gets the avatar of the user "emily"',
|
||||||
aliases: ["pfp"],
|
aliases: ['pfp'],
|
||||||
botPerms: ["EMBED_LINKS"]
|
botPerms: ['EMBED_LINKS']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ class Avatar extends Command {
|
||||||
if (!args[0]) {
|
if (!args[0]) {
|
||||||
const embed = this.createEmbed(message.author);
|
const embed = this.createEmbed(message.author);
|
||||||
return message.channel.send(embed);
|
return message.channel.send(embed);
|
||||||
};
|
}
|
||||||
|
|
||||||
let user = message.mentions.users.first();
|
let user = message.mentions.users.first();
|
||||||
|
|
||||||
|
@ -26,30 +26,30 @@ class Avatar extends Command {
|
||||||
return message.channel.send(
|
return message.channel.send(
|
||||||
'Found multiple users, please be more specific or @mention the user instead.'
|
'Found multiple users, please be more specific or @mention the user instead.'
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
if (user.length < 1) {
|
if (user.length < 1) {
|
||||||
return message.channel.send(
|
return message.channel.send(
|
||||||
'Specified user couldn\'t be found, check for typing errors.'
|
'Specified user couldn\'t be found, check for typing errors.'
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
user = user[0].user;
|
user = user[0].user;
|
||||||
|
|
||||||
const embed = this.createEmbed(user);
|
const embed = this.createEmbed(user);
|
||||||
return message.channel.send(embed);
|
return message.channel.send(embed);
|
||||||
};
|
}
|
||||||
|
|
||||||
createEmbed (user) {
|
createEmbed (user) {
|
||||||
const URL = user.avatarURL({format: "png", dynamic: true, size: 2048})
|
const URL = user.avatarURL({format: 'png', dynamic: true, size: 2048});
|
||||||
const embed = new Discord.MessageEmbed()
|
const embed = new Discord.MessageEmbed()
|
||||||
.setTitle(user.tag)
|
.setTitle(user.tag)
|
||||||
.setDescription(`**[Avatar URL](${URL})**`)
|
.setDescription(`**[Avatar URL](${URL})**`)
|
||||||
.setImage(URL);
|
.setImage(URL);
|
||||||
|
|
||||||
return embed;
|
return embed;
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
module.exports = Avatar;
|
module.exports = Avatar;
|
||||||
|
|
|
@ -4,6 +4,6 @@ module.exports = class {
|
||||||
}
|
}
|
||||||
|
|
||||||
async run (error) {
|
async run (error) {
|
||||||
this.client.logger.log(`An error event was sent by Discord.js: \n${JSON.stringify(error)}`, "error");
|
this.client.logger.log(`An error event was sent by Discord.js: \n${JSON.stringify(error)}`, 'error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue