aboutsummaryrefslogtreecommitdiff
path: root/commands/Utility
diff options
context:
space:
mode:
Diffstat (limited to 'commands/Utility')
-rw-r--r--commands/Utility/character.js14
-rw-r--r--commands/Utility/hinfo.js24
-rw-r--r--commands/Utility/invite.js4
-rw-r--r--commands/Utility/nick.js17
-rw-r--r--commands/Utility/suggest.js8
-rw-r--r--commands/Utility/uptime.js20
-rw-r--r--commands/Utility/userinfo.js10
7 files changed, 54 insertions, 43 deletions
diff --git a/commands/Utility/character.js b/commands/Utility/character.js
index 56d9bfb..2ed549e 100644
--- a/commands/Utility/character.js
+++ b/commands/Utility/character.js
@@ -8,14 +8,16 @@
* *************************************/
exports.run = (bot, msg, args) => {
- const { RichEmbed } = require('discord.js');
+ const {RichEmbed} = require('discord.js');
const embed = new RichEmbed()
.setTitle('***Character Analysis***')
.setDescription('Find out the decimal and hexadecimal of each and every character in a string.')
.setColor('#000');
const str = args.join(' ');
- if (str.length > 50) return msg.reply('The limit is 50 for how many characters you can input');
+ if (str.length > 50) {
+ return msg.reply('The limit is 50 for how many characters you can input');
+ }
const array = str.split('');
let decimal = '';
@@ -29,22 +31,22 @@ exports.run = (bot, msg, args) => {
const code = str.charCodeAt(x);
let codeHex = code.toString(16).toUpperCase();
while (codeHex.length < 4) {
- codeHex = '0' + codeHex;
+ codeHex = `0${codeHex}`;
}
hexadecimal += `\`\\u${codeHex}\`\t${array[x]}\n`;
}
embed.addField('*Hexadecimal*', hexadecimal, true);
- msg.channel.send({ embed });
+ msg.channel.send({embed});
};
exports.conf = {
aliases: [],
- guildOnly: true,
+ guildOnly: true
};
exports.help = {
name: 'character',
description: 'Gets the decimal and hexadecimal of (a) character(s)',
- usage: '<...characters>',
+ usage: '<...characters>'
};
diff --git a/commands/Utility/hinfo.js b/commands/Utility/hinfo.js
index 982a3bf..edffe5b 100644
--- a/commands/Utility/hinfo.js
+++ b/commands/Utility/hinfo.js
@@ -8,24 +8,24 @@
* *************************************/
exports.run = (bot, msg) => {
- const { RichEmbed } = require('discord.js');
- const os = require('os');
- const embed = new RichEmbed()
- .setTitle('Information on PokeBot\'s Host')
- .addField('OS Hostname: ', os.hostname() , true)
- .addField('NodeJS Version: ', process.versions.node , true)
- .addField('OS Platform: ', os.platform() , true)
- .addField('OS Version: ', os.release() , true)
- .setColor('#000000');
- msg.channel.send({embed});
+ const {RichEmbed} = require('discord.js');
+ const os = require('os');
+ const embed = new RichEmbed()
+ .setTitle('Information on PokeBot\'s Host')
+ .addField('OS Hostname: ', os.hostname(), true)
+ .addField('NodeJS Version: ', process.versions.node, true)
+ .addField('OS Platform: ', os.platform(), true)
+ .addField('OS Version: ', os.release(), true)
+ .setColor('#000000');
+ msg.channel.send({embed});
};
exports.conf = {
aliases: [],
- guildOnly: true,
+ guildOnly: true
};
exports.help = {
name: 'hinfo',
- description: 'Gives host information to user.',
+ description: 'Gives host information to user.'
};
diff --git a/commands/Utility/invite.js b/commands/Utility/invite.js
index 933e9ba..f029fcb 100644
--- a/commands/Utility/invite.js
+++ b/commands/Utility/invite.js
@@ -13,10 +13,10 @@ exports.run = (bot, msg) => {
exports.conf = {
aliases: [],
- guildOnly: true,
+ guildOnly: true
};
exports.help = {
name: 'invite',
- description: 'Gives the user a link to invite the bot.',
+ description: 'Gives the user a link to invite the bot.'
};
diff --git a/commands/Utility/nick.js b/commands/Utility/nick.js
index bec9578..f02af0f 100644
--- a/commands/Utility/nick.js
+++ b/commands/Utility/nick.js
@@ -8,14 +8,18 @@
* *************************************/
exports.run = async (bot, msg, args) => {
- const { RichEmbed } = require('discord.js');
+ const {RichEmbed} = require('discord.js');
msg.member.setNickname(args.join(' '), 'Requested by bot');
- msg.channel.send('Changed nickname to: ' + args.join(' '));
+ msg.channel.send(`Changed nickname to: ${args.join(' ')}`);
const logChannel = await bot.plugins.settings.getStr('logs', msg.member.guild.id);
- if (!logChannel) return;
+ if (!logChannel) {
+ return;
+ }
const channelObj = bot.channels.find('id', logChannel);
- if (!channelObj) return;
+ if (!channelObj) {
+ return;
+ }
channelObj.send(
new RichEmbed()
.setColor(0x00ae86)
@@ -25,16 +29,15 @@ exports.run = async (bot, msg, args) => {
.setTimestamp()
.setFooter('PokeBot v1.0')
);
-
};
exports.conf = {
aliases: ['nickname'],
- guildOnly: true,
+ guildOnly: true
};
exports.help = {
name: 'nick',
description: 'Change your nickname.',
- usage: '<...new nick>',
+ usage: '<...new nick>'
};
diff --git a/commands/Utility/suggest.js b/commands/Utility/suggest.js
index f1b4206..b935977 100644
--- a/commands/Utility/suggest.js
+++ b/commands/Utility/suggest.js
@@ -8,11 +8,11 @@
* *************************************/
exports.run = async (bot, msg, args) => {
- const { RichEmbed } = require('discord.js');
+ const {RichEmbed} = require('discord.js');
const suggestionChannel = await bot.plugins.settings.getStr('suggestions', msg.member.guild.id);
bot.channels.find('id', suggestionChannel).send(
new RichEmbed()
- .setColor (0x00ae86)
+ .setColor(0x00ae86)
.setTitle('Suggestion')
.setDescription('This is a suggestion from a community member for something relating to the server. Please rate it based on your opinion, and a staff member will decide what to do with the suggestion.')
.addField('Suggestion Contents', args.join(' '))
@@ -24,11 +24,11 @@ exports.run = async (bot, msg, args) => {
exports.conf = {
aliases: [],
- guildOnly: true,
+ guildOnly: true
};
exports.help = {
name: 'suggest',
description: 'Suggest a feature for the bot or the server.',
- usage: '<...suggestion>',
+ usage: '<...suggestion>'
};
diff --git a/commands/Utility/uptime.js b/commands/Utility/uptime.js
index 8492df2..dd072a4 100644
--- a/commands/Utility/uptime.js
+++ b/commands/Utility/uptime.js
@@ -15,22 +15,28 @@ exports.run = (bot, msg, args) => {
let hours = 0;
while (uptimeMinutes >= 60) {
hours++;
- uptimeMinutes = uptimeMinutes - 60;
+ uptimeMinutes -= 60;
}
const uptimeSeconds = minutes % 60;
- if (args[0] === 'ms') return msg.channel.send(bot.uptime + ' ms.');
- if (args[0] === 's') return msg.channel.send(uptimeSeconds + ' seconds.');
- if (args[0] === 'min') return msg.channel.send(Math.floor(uptime / 60) + ' minutes ' + uptimeSeconds + ' seconds.');
- msg.channel.send(':clock3: Pokebot has been up for ' + hours + ' hours, ' + uptimeMinutes + ' minutes, and ' + uptimeSeconds + ' seconds.');
+ if (args[0] === 'ms') {
+ return msg.channel.send(`${bot.uptime } ms.`);
+ }
+ if (args[0] === 's') {
+ return msg.channel.send(`${uptimeSeconds } seconds.`);
+ }
+ if (args[0] === 'min') {
+ return msg.channel.send(`${Math.floor(uptime / 60) } minutes ${ uptimeSeconds } seconds.`);
+ }
+ msg.channel.send(`:clock3: Pokebot has been up for ${ hours } hours, ${ uptimeMinutes } minutes, and ${ uptimeSeconds } seconds.`);
};
exports.conf = {
aliases: [],
- guildOnly: true,
+ guildOnly: true
};
exports.help = {
name: 'uptime',
- description: 'Get the uptime of the bot.',
+ description: 'Get the uptime of the bot.'
};
diff --git a/commands/Utility/userinfo.js b/commands/Utility/userinfo.js
index 80844e1..e57351d 100644
--- a/commands/Utility/userinfo.js
+++ b/commands/Utility/userinfo.js
@@ -7,8 +7,8 @@
*
* *************************************/
-exports.run = async (bot, msg) => {
- const { RichEmbed } = require('discord.js');
+exports.run = (bot, msg) => {
+ const {RichEmbed} = require('discord.js');
let user;
if (!msg.mentions.members.first()) {
user = msg.member;
@@ -22,18 +22,18 @@ exports.run = async (bot, msg) => {
.addField('User ID', user.id)
.addField('Account Creation Date', user.user.createdAt)
.addField('Join Guild Date', user.joinedAt)
- .addField('Names', 'Display Name: ' + user.displayName + `\nUsername: ${user.user.tag}`)
+ .addField('Names', `Display Name: ${user.displayName }\nUsername: ${user.user.tag}`)
.setFooter('PokeBot v1.0')
);
};
exports.conf = {
aliases: ['uinfo', 'userinformation'],
- guildOnly: true,
+ guildOnly: true
};
exports.help = {
name: 'userinfo',
description: 'Shows information about the mentioned user',
- usage: '@user',
+ usage: '@user'
};