mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 00:07:36 +02:00
throwback
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class CanYouNotCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'can-you-not',
|
||||
group: 'random',
|
||||
memberName: 'can-you-not',
|
||||
description: 'Can YOU not?'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say('Can YOU not?');
|
||||
}
|
||||
};
|
||||
@@ -1,31 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const eastereggs = require('../../assets/json/easter-egg');
|
||||
|
||||
module.exports = class EasterEggCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'easter-egg',
|
||||
aliases: ['tag'],
|
||||
group: 'random',
|
||||
memberName: 'easter-egg',
|
||||
description: 'Can you discover all the easter eggs?',
|
||||
args: [
|
||||
{
|
||||
key: 'tag',
|
||||
prompt: 'What easter egg do you want to view?',
|
||||
type: 'string',
|
||||
validate: tag => {
|
||||
if (eastereggs[tag.toLowerCase()]) return true;
|
||||
return 'Nope, that\'s not a valid easter egg. Try again!';
|
||||
},
|
||||
parse: tag => tag.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { tag } = args;
|
||||
return msg.say(eastereggs[tag]);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class EatPantCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'eat-pant',
|
||||
group: 'random',
|
||||
memberName: 'eat-pant',
|
||||
description: 'eat pant',
|
||||
clientPermissions: ['ATTACH_FILES']
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say({ files: ['https://i.imgur.com/9zWcsXx.jpg'] });
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class SlowClapCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'slow-clap',
|
||||
group: 'random',
|
||||
memberName: 'slow-clap',
|
||||
description: '_slow clap_'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say('_slow clap_');
|
||||
}
|
||||
};
|
||||
@@ -1,57 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { ALPHA_VANTAGE_KEY } = process.env;
|
||||
|
||||
module.exports = class StocksCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'stocks',
|
||||
aliases: ['stock'],
|
||||
group: 'random',
|
||||
memberName: 'stocks',
|
||||
description: 'Get the current stocks for a symbol.',
|
||||
args: [
|
||||
{
|
||||
key: 'symbol',
|
||||
prompt: 'What symbol would you like to get the stocks for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { symbol } = args;
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://www.alphavantage.co/query')
|
||||
.query({
|
||||
function: 'TIME_SERIES_INTRADAY',
|
||||
symbol,
|
||||
interval: '1min',
|
||||
apikey: ALPHA_VANTAGE_KEY
|
||||
});
|
||||
if (body['Error Message']) return msg.say('Could not find any results.');
|
||||
const data = Object.values(body['Time Series (1min)'])[0];
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`Stocks for Symbol ${symbol.toUpperCase()}`)
|
||||
.setColor(0x9797FF)
|
||||
.addField('❯ Open',
|
||||
`$${data['1. open']}`, true)
|
||||
.addField('❯ Close',
|
||||
`$${data['4. close']}`, true)
|
||||
.addField('❯ Volume',
|
||||
data['5. volume'], true)
|
||||
.addField('❯ High',
|
||||
`$${data['2. high']}`, true)
|
||||
.addField('❯ Low',
|
||||
`$${data['3. low']}`, true)
|
||||
.addField('❯ Last Updated',
|
||||
new Date(body['Meta Data']['3. Last Refreshed']).toDateString(), true);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { list } = require('../../structures/Util');
|
||||
const tags = require('../../assets/json/tag');
|
||||
|
||||
module.exports = class TagCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'tag',
|
||||
aliases: ['easter-egg', 'mini-command'],
|
||||
group: 'random',
|
||||
memberName: 'tag',
|
||||
description: 'Little mini responses that didn\'t quite make the command cut.',
|
||||
args: [
|
||||
{
|
||||
key: 'tag',
|
||||
prompt: `What tag do you want to view? Either ${list(Object.keys(tags), 'or')}.`,
|
||||
type: 'string',
|
||||
validate: tag => {
|
||||
if (tags[tag.toLowerCase()]) return true;
|
||||
return `Invalid tag, please enter either ${list(Object.keys(tags), 'or')}.`;
|
||||
},
|
||||
parse: tag => tag.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { tag } = args;
|
||||
return msg.say(tags[tag]);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user