remove legacy commands
This commit is contained in:
parent
a2fe5d4dca
commit
7038dc1c6f
3 changed files with 0 additions and 197 deletions
|
@ -1,34 +0,0 @@
|
|||
module.exports = class {
|
||||
constructor (name, category) {
|
||||
this.name = name,
|
||||
this.category = category,
|
||||
this.enabled = true,
|
||||
this.devOnly = false,
|
||||
this.aliases = [],
|
||||
this.userPerms = [],
|
||||
this.botPerms = [],
|
||||
this.cooldown = 2000,
|
||||
this.help = {
|
||||
description: '',
|
||||
arguments: '',
|
||||
details: '',
|
||||
examples: ''
|
||||
};
|
||||
}
|
||||
|
||||
run (client, message, args, data) { //eslint-disable-line no-unused-vars
|
||||
const guild = message.guild;
|
||||
|
||||
const embed = new client.MessageEmbed()
|
||||
.setColor(client.functions.embedColor(message.guild))
|
||||
.setTitle(guild.name)
|
||||
.setThumbnail(guild.iconURL)
|
||||
.addField('ID', guild.id, true)
|
||||
.addField('Owner', `<@${guild.ownerId}>`, true)
|
||||
.addField('Region', guild.region.toProperCase(), true)
|
||||
.addField('Boosts', `${guild.premiumSubscriptionCount} (Level ${guild.premiumTier})`, true)
|
||||
.addField('Member Count (Approximate)', `${guild.memberCount} (${guild.memberCount - guild.members.filter(member => member.user.bot).length} humans, ${guild.members.filter(member => member.user.bot).length} bots)`, true)
|
||||
.addField('Channels', `${guild.channels.size} ()`)
|
||||
message.channel.send({ embeds: [embed] });
|
||||
}
|
||||
};
|
|
@ -1,78 +0,0 @@
|
|||
const dayjs = require('dayjs');
|
||||
dayjs.extend(require('dayjs/plugin/relativeTime'));
|
||||
|
||||
module.exports = class {
|
||||
constructor (name, category) {
|
||||
this.name = name,
|
||||
this.category = category,
|
||||
this.enabled = true,
|
||||
this.devOnly = false,
|
||||
this.aliases = ['user'],
|
||||
this.userPerms = [],
|
||||
this.botPerms = [],
|
||||
this.cooldown = 2000,
|
||||
this.help = {
|
||||
description: 'Get information on a user.',
|
||||
arguments: '[user]',
|
||||
details: '',
|
||||
examples: 'userinfo\nuserinfo Octavia\nuserinfo @Animals'
|
||||
};
|
||||
}
|
||||
|
||||
async run (client, message, args, data) { //eslint-disable-line no-unused-vars
|
||||
let member = message.member;
|
||||
|
||||
if (args[0]) {
|
||||
if (message.mentions.length > 0) {
|
||||
member = await message.guild.members.fetch(message.mentions[0].id)
|
||||
} else {
|
||||
member = await client.functions.validateUserID(message.guild, args[0]);
|
||||
|
||||
if (!member) {
|
||||
member = await message.guild.searchMembers(args.join(' '), 2);
|
||||
|
||||
if (member.length === 0) return message.channel.send(
|
||||
`${client.config.emojis.userError} No users found. Check for mispellings, or ping the user instead.`
|
||||
);
|
||||
|
||||
if (member.length > 1) return message.channel.send(
|
||||
`${client.config.emojis.userError} Found more than one user, try refining your search or pinging the user instead.`
|
||||
);
|
||||
|
||||
member = member[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const badges = [];
|
||||
|
||||
if (client.config.ownerIDs.includes(member.id)) badges.push('<:Woomy_Developer:816822318289518622> ');
|
||||
if (member.id === member.guild.ownerId) badges.push('<:owner:685703193694306331>');
|
||||
if (member.bot) badges.push('<:bot:686489601678114859>');
|
||||
|
||||
const roles = [];
|
||||
|
||||
for (const roleID of member.roles) {
|
||||
if (roles.length === 45) {
|
||||
roles.push(`and ${member.roles.length - 45} more`);
|
||||
break;
|
||||
}
|
||||
|
||||
roles.push(`<@&${roleID}>`);
|
||||
}
|
||||
|
||||
const embed = new client.MessageEmbed()
|
||||
.setTitle(member.user.username + '#' + member.user.discriminator)
|
||||
.setColor(client.functions.embedColor(message.guild, member))
|
||||
.setThumbnail(member.user.avatarURL || member.user.defaultAvatarURL)
|
||||
.addField('Display Name', member.nick || member.user.username, true)
|
||||
.addField('User ID', member.id, true)
|
||||
.addField('Highest Role', `<@&${client.functions.highestRole(member).id}>`, true)
|
||||
.addField('Roles:', roles.join(' '))
|
||||
.addField('Joined Server', `${dayjs(member.joinedAt).format('D/M/YYYY HH:mm (UTCZ)')}\n*${dayjs().to(member.joinedAt)}*`, true)
|
||||
.addField('Joined Discord', `${dayjs(member.user.createdAt).format('D/M/YYYY HH:mm (UTCZ)')}\n*${dayjs().to(member.user.createdAt)}*`, true);
|
||||
if (badges.length > 0) embed.setDescription(badges.join(' '));
|
||||
|
||||
message.channel.send({ embeds: [embed] });
|
||||
}
|
||||
};
|
|
@ -1,85 +0,0 @@
|
|||
const fetch = require('node-fetch');
|
||||
const windrose = require('windrose');
|
||||
const ISO2 = require('../../assets/ISO2.json');
|
||||
|
||||
|
||||
module.exports = class {
|
||||
constructor (name, category) {
|
||||
this.name = name,
|
||||
this.category = category,
|
||||
this.enabled = true,
|
||||
this.devOnly = false,
|
||||
this.aliases = [],
|
||||
this.userPerms = [],
|
||||
this.botPerms = [],
|
||||
this.cooldown = 2000,
|
||||
this.help = {
|
||||
description: 'Gives you the weather for the specified city. You can also specify a country code with a comma.',
|
||||
arguments: '<city>, [code]',
|
||||
details: '`<city>` - name of a city\n`[code]` - country code (USA = US, Australia = AU, etc.)',
|
||||
examples: 'w!weather Minneapolis\nw!weather Melbourne, AU'
|
||||
};
|
||||
}
|
||||
|
||||
async run (client, message, args, data) { //eslint-disable-line no-unused-vars
|
||||
if (!args[0]) return;
|
||||
|
||||
let city = args.join(' ').toProperCase();
|
||||
let countryCode = ',';
|
||||
|
||||
if (args.join(' ').indexOf(',') > -1) {
|
||||
const params = city.split(',');
|
||||
city = params[0].trim().toProperCase();
|
||||
if (ISO2.country[params[1].toProperCase().trim()]) {
|
||||
countryCode += ISO2.country[params[1].toProperCase().trim()];
|
||||
} else {
|
||||
countryCode += params[1].trim();
|
||||
}
|
||||
}
|
||||
|
||||
const editMessage = await message.channel.send(`${client.config.emojis.loading} Please wait...`);
|
||||
fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city + countryCode}&appid=${client.config.keys.weather}`, { headers: { 'User-Agent': client.config.userAgent }})
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
if (json.cod >= 200 && json.cod <= 299) {
|
||||
const tempCelcius = Math.round(json.main.temp - 273.15);
|
||||
let embedColour;
|
||||
if (tempCelcius < 0) {
|
||||
embedColour = '#addeff';
|
||||
} else if (tempCelcius < 20) {
|
||||
embedColour = '#4fb8ff';
|
||||
} else if (tempCelcius < 26) {
|
||||
embedColour = '#ffea4f';
|
||||
} else if (tempCelcius < 31) {
|
||||
embedColour = '#ffa14f';
|
||||
} else {
|
||||
embedColour = '#ff614f';
|
||||
}
|
||||
|
||||
const embed = new client.MessageEmbed()
|
||||
.setTitle(`Weather for ${city + ', ' + ISO2.code[json.sys.country]}`)
|
||||
.setThumbnail(`https://openweathermap.org/img/wn/${json.weather[0].icon}@4x.png`)
|
||||
.setColor(embedColour)
|
||||
.addField('Condition:', json.weather[0].main, true)
|
||||
.addField('Temperature:', `${tempCelcius}°C | ${Math.round(json.main.temp * 9/5 - 459.67)}°F`, true)
|
||||
.addField('Min/Max:', `
|
||||
${Math.round(json.main.temp_min - 273.15)}°C - ${Math.round(json.main.temp_max - 273.15)}°C
|
||||
${Math.round(json.main.temp_min * 9/5 - 459.67)}°F - ${Math.round(json.main.temp_max * 9/5 - 459.67)}°F
|
||||
`, true)
|
||||
.addField('Humidity:', `${json.main.humidity}%`, true)
|
||||
.addField('Wind Speed:', `${Math.round(json.wind.speed * 10) / 10}km/h | ${Math.round(json.wind.speed * 10 / 1.609344)}mi/h`, true)
|
||||
.addField('Wind Direction:', windrose.getPoint(json.wind.deg).name, true)
|
||||
.setFooter('Powered by openweathermap.org');
|
||||
return editMessage.edit({ content: null, embeds: [embed] });
|
||||
} else {
|
||||
if (json.message && json.message === 'city not found') {
|
||||
return message.channel.send(`${client.config.emojis.userError} You provided an invalid city name. Maybe check your spelling?`);
|
||||
}
|
||||
return message.channel.send(`${client.config.emojis.botError} API error occured: \`code ${json.cod}: ${json.message}\``);
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
return message.channel.send(`${client.config.emojis.botError} An error has occured: \`${err.stack}\``);
|
||||
});
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue