mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 21:40:49 +02:00
Why does this even work
This commit is contained in:
@@ -48,13 +48,8 @@ module.exports = class GoogleFeudCommand extends Command {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const choice = msgs.first().content.toLowerCase();
|
const choice = msgs.first().content.toLowerCase();
|
||||||
if (suggestions.includes(choice)) {
|
if (suggestions.includes(choice)) display[suggestions.indexOf(choice)] = choice;
|
||||||
await msg.say('Nice job!');
|
else --tries;
|
||||||
display[suggestions.indexOf(choice)] = choice;
|
|
||||||
} else {
|
|
||||||
--tries;
|
|
||||||
if (tries) await msg.say(`Nope! ${tries} tries remaining!`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.playing.delete(msg.channel.id);
|
this.playing.delete(msg.channel.id);
|
||||||
if (!display.includes('???')) return msg.say('You win! Nice job, master of Google!');
|
if (!display.includes('???')) return msg.say('You win! Nice job, master of Google!');
|
||||||
|
|||||||
@@ -24,9 +24,10 @@ module.exports = class KitsuAnimeCommand extends Command {
|
|||||||
|
|
||||||
async run(msg, { query }) {
|
async run(msg, { query }) {
|
||||||
try {
|
try {
|
||||||
const { body } = await request
|
const { text } = await request
|
||||||
.get('https://kitsu.io/api/edge/anime')
|
.get('https://kitsu.io/api/edge/anime')
|
||||||
.query({ 'filter[text]': query });
|
.query({ 'filter[text]': query });
|
||||||
|
const body = JSON.parse(text);
|
||||||
if (!body.data.length) return msg.say('Could not find any results.');
|
if (!body.data.length) return msg.say('Could not find any results.');
|
||||||
const data = body.data[0].attributes;
|
const data = body.data[0].attributes;
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
|
|||||||
@@ -24,9 +24,10 @@ module.exports = class KitsuMangaCommand extends Command {
|
|||||||
|
|
||||||
async run(msg, { query }) {
|
async run(msg, { query }) {
|
||||||
try {
|
try {
|
||||||
const { body } = await request
|
const { text } = await request
|
||||||
.get('https://kitsu.io/api/edge/manga')
|
.get('https://kitsu.io/api/edge/manga')
|
||||||
.query({ 'filter[text]': query });
|
.query({ 'filter[text]': query });
|
||||||
|
const body = JSON.parse(text);
|
||||||
if (!body.data.length) return msg.say('Could not find any results.');
|
if (!body.data.length) return msg.say('Could not find any results.');
|
||||||
const data = body.data[0].attributes;
|
const data = body.data[0].attributes;
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ module.exports = class LeagueOfLegendsChampionCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'league-of-legends-champion',
|
name: 'league-of-legends-champion',
|
||||||
aliases: ['lol-champion', 'league-of-legends-champ', 'lol-champ'],
|
aliases: ['lol-champion', 'league-of-legends-champ', 'lol-champ', 'league-champ'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'league-of-legends-champion',
|
memberName: 'league-of-legends-champion',
|
||||||
description: 'Responds with information on a League of Legends champion.',
|
description: 'Responds with information on a League of Legends champion.',
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ module.exports = class NeopetsItemCommand extends Command {
|
|||||||
async run(msg, { item }) {
|
async run(msg, { item }) {
|
||||||
try {
|
try {
|
||||||
const data = await this.fetchItem(item);
|
const data = await this.fetchItem(item);
|
||||||
if (!data) return msg.say('Could not find any results');
|
if (!data) return msg.say('Could not find any results.');
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setColor(0xFFCE31)
|
.setColor(0xFFCE31)
|
||||||
.setAuthor('Neopets', 'https://i.imgur.com/BP8qxJH.png', 'http://www.neopets.com/')
|
.setAuthor('Neopets', 'https://i.imgur.com/BP8qxJH.png', 'http://www.neopets.com/')
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ module.exports = class RottenTomatoesCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'rotten-tomatoes',
|
name: 'rotten-tomatoes',
|
||||||
aliases: ['tomato-meter'],
|
aliases: ['tomato-meter', 'r-tomatoes'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'rotten-tomatoes',
|
memberName: 'rotten-tomatoes',
|
||||||
description: 'Searches Rotten Tomatoes for your query.',
|
description: 'Searches Rotten Tomatoes for your query.',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ module.exports = class RuleOfTheInternetCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'rule-of-the-internet',
|
name: 'rule-of-the-internet',
|
||||||
aliases: ['rules-of-the-internet', 'internet-rule', 'rule'],
|
aliases: ['rules-of-the-internet', 'internet-rule', 'rule', 'rules'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'rule-of-the-internet',
|
memberName: 'rule-of-the-internet',
|
||||||
description: 'Responds with a rule of the internet.',
|
description: 'Responds with a rule of the internet.',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ module.exports = class YoutubeCommand extends Command {
|
|||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'youtube',
|
name: 'youtube',
|
||||||
aliases: ['youtube-video'],
|
aliases: ['youtube-video', 'y-tube', 'u-tube'],
|
||||||
group: 'search',
|
group: 'search',
|
||||||
memberName: 'youtube',
|
memberName: 'youtube',
|
||||||
description: 'Searches YouTube for your query.',
|
description: 'Searches YouTube for your query.',
|
||||||
|
|||||||
@@ -35,11 +35,17 @@ module.exports = class DECTalkCommand extends Command {
|
|||||||
if (this.client.voiceConnections.has(channel.guild.id)) return msg.say('I am already playing a sound.');
|
if (this.client.voiceConnections.has(channel.guild.id)) return msg.say('I am already playing a sound.');
|
||||||
try {
|
try {
|
||||||
const connection = await channel.join();
|
const connection = await channel.join();
|
||||||
const { headers } = await request
|
let url = 'http://tts.cyzon.us';
|
||||||
.get('http://tts.cyzon.us/tts')
|
try {
|
||||||
.query({ text })
|
await request
|
||||||
.redirects(0);
|
.get('http://tts.cyzon.us/tts')
|
||||||
const dispatcher = connection.play(`http://tts.cyzon.us${headers.location}`);
|
.query({ text })
|
||||||
|
.redirects(0);
|
||||||
|
} catch (err) {
|
||||||
|
if (err.headers.location) url += err.headers.location;
|
||||||
|
else throw err;
|
||||||
|
}
|
||||||
|
const dispatcher = connection.play(url);
|
||||||
dispatcher.once('finish', () => channel.leave());
|
dispatcher.once('finish', () => channel.leave());
|
||||||
dispatcher.once('error', () => channel.leave());
|
dispatcher.once('error', () => channel.leave());
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user