mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 00:12:38 +02:00
Remove more commands
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const RSS = require('rss-parser');
|
||||
const { stripIndents } = require('common-tags');
|
||||
|
||||
module.exports = class TheOnionCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'the-onion',
|
||||
aliases: ['onion'],
|
||||
group: 'random-res',
|
||||
memberName: 'the-onion',
|
||||
description: 'Responds with a random "The Onion" article.',
|
||||
credit: [
|
||||
{
|
||||
name: 'The Onion',
|
||||
url: 'https://www.theonion.com/',
|
||||
reason: 'RSS Feed',
|
||||
reasonURL: 'https://www.theonion.com/rss'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
const parser = new RSS();
|
||||
try {
|
||||
const feed = await parser.parseURL('https://www.theonion.com/rss');
|
||||
const article = feed.items[Math.floor(Math.random() * feed.items.length)];
|
||||
return msg.say(stripIndents`
|
||||
${article.title}
|
||||
${article.link}
|
||||
`);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,32 +0,0 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class ThisForThatCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'this-for-that',
|
||||
aliases: ['its-this-for-that'],
|
||||
group: 'random-res',
|
||||
memberName: 'this-for-that',
|
||||
description: 'So, basically, it\'s like a bot command for this dumb meme.',
|
||||
credit: [
|
||||
{
|
||||
name: 'Wait, what does your startup do?',
|
||||
url: 'http://itsthisforthat.com/',
|
||||
reason: 'API',
|
||||
reasonURL: 'http://itsthisforthat.com/api.php'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
try {
|
||||
const { text } = await request.get('http://itsthisforthat.com/api.php?json');
|
||||
const body = JSON.parse(text);
|
||||
return msg.say(`So, basically, it's like a ${body.this} for ${body.that}.`);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,17 +0,0 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const UserAgent = require('user-agents');
|
||||
|
||||
module.exports = class UserAgentCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'user-agent',
|
||||
group: 'random-res',
|
||||
memberName: 'user-agent',
|
||||
description: 'Responds with a random User Agent.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say(new UserAgent().toString());
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user