mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 21:40:51 +02:00
23
This commit is contained in:
@@ -12,7 +12,7 @@ module.exports = class AnimeCommand extends Command {
|
||||
name: 'anime',
|
||||
group: 'search',
|
||||
memberName: 'anime',
|
||||
description: 'Searches My Anime List for a specified anime.',
|
||||
description: 'Searches My Anime List for your query, getting anime results.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = class BulbapediaCommand extends Command {
|
||||
aliases: ['bulbagarden'],
|
||||
group: 'search',
|
||||
memberName: 'bulbapedia',
|
||||
description: 'Searches Bulbapedia for something.',
|
||||
description: 'Searches Bulbapedia for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = class DanbooruCommand extends Command {
|
||||
name: 'danbooru',
|
||||
group: 'search',
|
||||
memberName: 'danbooru',
|
||||
description: 'Sends an image from Danbooru, with optional query.',
|
||||
description: 'Searches Danbooru with optional query.',
|
||||
nsfw: true,
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = class ForecastCommand extends Command {
|
||||
name: 'forecast',
|
||||
group: 'search',
|
||||
memberName: 'forecast',
|
||||
description: 'Gets the seven-day forecast for a specified location.',
|
||||
description: 'Responds with the seven-day forecast for a specified location.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
@@ -41,43 +41,43 @@ module.exports = class ForecastCommand extends Command {
|
||||
**High:** ${forecasts[0].high}°F
|
||||
**Low:** ${forecasts[0].low}°F
|
||||
**Condition:** ${forecasts[0].text}
|
||||
`, true)
|
||||
`)
|
||||
.addField(`❯ ${forecasts[1].day} - ${forecasts[1].date}`,
|
||||
stripIndents`
|
||||
**High:** ${forecasts[1].high}°F
|
||||
**Low:** ${forecasts[1].low}°F
|
||||
**Condition:** ${forecasts[1].text}
|
||||
`, true)
|
||||
`)
|
||||
.addField(`❯ ${forecasts[2].day} - ${forecasts[2].date}`,
|
||||
stripIndents`
|
||||
**High:** ${forecasts[2].high}°F
|
||||
**Low:** ${forecasts[2].low}°F
|
||||
**Condition:** ${forecasts[2].text}
|
||||
`, true)
|
||||
`)
|
||||
.addField(`❯ ${forecasts[3].day} - ${forecasts[3].date}`,
|
||||
stripIndents`
|
||||
**High:** ${forecasts[3].high}°F
|
||||
**Low:** ${forecasts[3].low}°F
|
||||
**Condition:** ${forecasts[3].text}
|
||||
`, true)
|
||||
`)
|
||||
.addField(`❯ ${forecasts[4].day} - ${forecasts[4].date}`,
|
||||
stripIndents`
|
||||
**High:** ${forecasts[4].high}°F
|
||||
**Low:** ${forecasts[4].low}°F
|
||||
**Condition:** ${forecasts[4].text}
|
||||
`, true)
|
||||
`)
|
||||
.addField(`❯ ${forecasts[5].day} - ${forecasts[5].date}`,
|
||||
stripIndents`
|
||||
**High:** ${forecasts[5].high}°F
|
||||
**Low:** ${forecasts[5].low}°F
|
||||
**Condition:** ${forecasts[5].text}
|
||||
`, true)
|
||||
`)
|
||||
.addField(`❯ ${forecasts[6].day} - ${forecasts[6].date}`,
|
||||
stripIndents`
|
||||
**High:** ${forecasts[6].high}°F
|
||||
**Low:** ${forecasts[6].low}°F
|
||||
**Condition:** ${forecasts[6].text}
|
||||
`, true);
|
||||
`);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = class GelbooruCommand extends Command {
|
||||
name: 'gelbooru',
|
||||
group: 'search',
|
||||
memberName: 'gelbooru',
|
||||
description: 'Sends an image from Gelbooru, with query.',
|
||||
description: 'Searches Gelbooru for your query.',
|
||||
nsfw: true,
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = class GiphyCommand extends Command {
|
||||
name: 'giphy',
|
||||
group: 'search',
|
||||
memberName: 'giphy',
|
||||
description: 'Searches for GIFs with Giphy.',
|
||||
description: 'Searches Giphy for your query.',
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = class GithubCommand extends Command {
|
||||
name: 'github',
|
||||
group: 'search',
|
||||
memberName: 'github',
|
||||
description: 'Gets repo information from GitHub.',
|
||||
description: 'Responds with repo information from a GitHub repository.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = class GoogleCommand extends Command {
|
||||
name: 'google',
|
||||
group: 'search',
|
||||
memberName: 'google',
|
||||
description: 'Searches Google.',
|
||||
description: 'Searches Google for your query.',
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
@@ -23,13 +23,17 @@ module.exports = class GoogleCommand extends Command {
|
||||
async run(msg, args) {
|
||||
const { query } = args;
|
||||
const message = await msg.say('Searching...');
|
||||
const { text } = await snekfetch
|
||||
.get('https://www.google.com/search')
|
||||
.query({ q: query });
|
||||
const $ = cheerio.load(text);
|
||||
let href = $('.r').first().find('a').first().attr('href');
|
||||
if (!href) return message.edit('No Results.');
|
||||
href = querystring.parse(href.replace('/url?', ''));
|
||||
return message.edit(href.q);
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
.get('https://www.google.com/search')
|
||||
.query({ q: query });
|
||||
const $ = cheerio.load(text);
|
||||
let href = $('.r').first().find('a').first().attr('href');
|
||||
if (!href) throw new Error('No Results');
|
||||
href = querystring.parse(href.replace('/url?', ''));
|
||||
return message.edit(href.q);
|
||||
} catch (err) {
|
||||
return message.edit(err.message);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = class KonachanCommand extends Command {
|
||||
name: 'konachan',
|
||||
group: 'search',
|
||||
memberName: 'konachan',
|
||||
description: 'Sends an image from Konachan, with optional query.',
|
||||
description: 'Searches Konachan with optional query.',
|
||||
nsfw: true,
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
|
||||
module.exports = class LMGTFYCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'lmgtfy',
|
||||
group: 'search',
|
||||
memberName: 'lmgtfy',
|
||||
description: 'Responds with a LMGTFY link.',
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
prompt: 'What would you like to the link to search for?',
|
||||
type: 'string',
|
||||
parse: (query) => encodeURIComponent(query)
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) {
|
||||
const { query } = args;
|
||||
return msg.say(`http://lmgtfy.com/?iie=1&q=${query}`);
|
||||
}
|
||||
};
|
||||
@@ -12,7 +12,7 @@ module.exports = class MangaCommand extends Command {
|
||||
name: 'manga',
|
||||
group: 'search',
|
||||
memberName: 'manga',
|
||||
description: 'Searches My Anime List for a specified manga.',
|
||||
description: 'Searches My Anime List for your query, getting manga results.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = class MapCommand extends Command {
|
||||
name: 'map',
|
||||
group: 'search',
|
||||
memberName: 'map',
|
||||
description: 'Gets a map image for the location you define with the zoom level you define (1-20).',
|
||||
description: 'Responds with a map based upon your query.',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = class NeopetCommand extends Command {
|
||||
name: 'neopet',
|
||||
group: 'search',
|
||||
memberName: 'neopet',
|
||||
description: 'Gives a Neopet\'s image, searchable by name.',
|
||||
description: 'Searches for Neopets with the username of your query.',
|
||||
args: [
|
||||
{
|
||||
key: 'query',
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = class OsuCommand extends Command {
|
||||
name: 'osu',
|
||||
group: 'search',
|
||||
memberName: 'osu',
|
||||
description: 'Searches Osu! user data.',
|
||||
description: 'Searches osu! usernames for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = class Rule34Command extends Command {
|
||||
name: 'rule34',
|
||||
group: 'search',
|
||||
memberName: 'rule34',
|
||||
description: 'Sends an image from Rule34, with query.',
|
||||
description: 'Searches Rule34 for your query.',
|
||||
nsfw: true,
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = class SoundCloudCommand extends Command {
|
||||
name: 'soundcloud',
|
||||
group: 'search',
|
||||
memberName: 'soundcloud',
|
||||
description: 'Searches SoundCloud for a song.',
|
||||
description: 'Searches SoundCloud for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = class UrbanCommand extends Command {
|
||||
name: 'urban',
|
||||
group: 'search',
|
||||
memberName: 'urban',
|
||||
description: 'Searches Urban Dictionary for a word.',
|
||||
description: 'Searches Urban Dictionary for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = class WattpadCommand extends Command {
|
||||
name: 'wattpad',
|
||||
group: 'search',
|
||||
memberName: 'wattpad',
|
||||
description: 'Searches Wattpad for a book.',
|
||||
description: 'Searches Wattpad for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = class WeatherCommand extends Command {
|
||||
name: 'weather',
|
||||
group: 'search',
|
||||
memberName: 'weather',
|
||||
description: 'Gets weather information for a specified location.',
|
||||
description: 'Responds with weather information for a specified location.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = class WikipediaCommand extends Command {
|
||||
name: 'wikipedia',
|
||||
group: 'search',
|
||||
memberName: 'wikipedia',
|
||||
description: 'Searches Wikipedia for something.',
|
||||
description: 'Searches Wikipedia for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = class XKCDCommand extends Command {
|
||||
aliases: ['kcd'],
|
||||
group: 'search',
|
||||
memberName: 'xkcd',
|
||||
description: 'Gets an XKCD Comic, optionally opting for today\'s or random.',
|
||||
description: 'Gets an XKCD Comic, optionally opting for today\'s or a specific number.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = class YouTubeCommand extends Command {
|
||||
name: 'youtube',
|
||||
group: 'search',
|
||||
memberName: 'youtube',
|
||||
description: 'Searches YouTube for a video.',
|
||||
description: 'Searches YouTube for your query.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = class YuGiOhCommand extends Command {
|
||||
name: 'yu-gi-oh',
|
||||
group: 'search',
|
||||
memberName: 'yu-gi-oh',
|
||||
description: 'Gets info on a Yu-Gi-Oh! Card.',
|
||||
description: 'Responds with info on a Yu-Gi-Oh! card.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user