mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Use imgur albums for random image commands
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
[
|
||||
"https://i.imgur.com/O1PpKIM.png",
|
||||
"https://i.imgur.com/UUDnevJ.jpg",
|
||||
"https://i.imgur.com/8qTYRd7.png",
|
||||
"https://i.imgur.com/g9QZRl3.jpg",
|
||||
"https://i.imgur.com/OQMpY8c.jpg",
|
||||
"https://i.imgur.com/e7rEjLA.jpg",
|
||||
"https://i.imgur.com/2JrLfHP.png",
|
||||
"https://i.imgur.com/q95iQIA.jpg",
|
||||
"https://i.imgur.com/8oyH1nv.jpg",
|
||||
"https://i.imgur.com/tDljuxk.png",
|
||||
"https://i.imgur.com/s56bWfY.jpg",
|
||||
"https://i.imgur.com/ycX6iOI.png",
|
||||
"https://i.imgur.com/RixbWXs.jpg",
|
||||
"https://i.imgur.com/J8V9v4Q.jpg",
|
||||
"https://i.imgur.com/uDVtLns.jpg",
|
||||
"https://i.imgur.com/cPKI2Kq.jpg",
|
||||
"https://i.imgur.com/2FgIVhO.png",
|
||||
"https://i.imgur.com/Vxz0BFU.jpg",
|
||||
"https://i.imgur.com/jt4R4mK.png",
|
||||
"https://i.imgur.com/zRhXdhd.png",
|
||||
"https://i.imgur.com/l45arMd.jpg",
|
||||
"https://i.imgur.com/hjE5rLf.jpg",
|
||||
"https://i.imgur.com/fFrdYmO.png",
|
||||
"https://i.imgur.com/W8jerBP.jpg",
|
||||
"https://i.imgur.com/h2OH8iO.jpg"
|
||||
]
|
||||
@@ -1,27 +0,0 @@
|
||||
[
|
||||
"https://i.imgur.com/7yQdFC2.jpg",
|
||||
"https://i.imgur.com/76S8DP5.jpg",
|
||||
"https://i.imgur.com/2OmeiAr.jpg",
|
||||
"https://i.imgur.com/kHaOJhF.jpg",
|
||||
"https://i.imgur.com/SS0edvc.jpg",
|
||||
"https://i.imgur.com/T41LFTl.png",
|
||||
"https://i.imgur.com/BxZaxCM.png",
|
||||
"https://i.imgur.com/8kdR6Pn.png",
|
||||
"https://i.imgur.com/Ygt9WwI.jpg",
|
||||
"https://i.imgur.com/8sUZzzf.jpg",
|
||||
"https://i.imgur.com/m160og9.jpg",
|
||||
"https://i.imgur.com/HharYbL.jpg",
|
||||
"https://i.imgur.com/hroKoWi.jpg",
|
||||
"https://i.imgur.com/NWxk4Lu.jpg",
|
||||
"https://i.imgur.com/SUFg7LM.png",
|
||||
"https://i.imgur.com/lcmlAlK.png",
|
||||
"https://i.imgur.com/dCJItk8.jpg",
|
||||
"https://i.imgur.com/iSzuoCl.jpg",
|
||||
"https://i.imgur.com/PjfSo5K.jpg",
|
||||
"https://i.imgur.com/Ln88AEW.png",
|
||||
"https://i.imgur.com/1IX39AP.gif",
|
||||
"https://i.imgur.com/AYu5QF1.png",
|
||||
"https://i.imgur.com/dAvcP4K.png",
|
||||
"https://i.imgur.com/tsul2xB.jpg",
|
||||
"https://i.imgur.com/pESXaS0.jpg"
|
||||
]
|
||||
@@ -1,30 +0,0 @@
|
||||
[
|
||||
"https://i.imgur.com/qZYuM84.jpg",
|
||||
"https://i.imgur.com/shfH7Rn.png",
|
||||
"https://i.imgur.com/wneFRY7.jpg",
|
||||
"https://i.imgur.com/MpQgKHU.jpg",
|
||||
"https://i.imgur.com/guJ29wp.png",
|
||||
"https://i.imgur.com/a4TsRS1.jpg",
|
||||
"https://i.imgur.com/w2rmDfM.jpg",
|
||||
"https://i.imgur.com/DyW1DJ0.jpg",
|
||||
"https://i.imgur.com/iB6durw.png",
|
||||
"https://i.imgur.com/hstWdiN.jpg",
|
||||
"https://i.imgur.com/HLJXkQk.jpg",
|
||||
"https://i.imgur.com/x8cA0Mw.jpg",
|
||||
"https://i.imgur.com/8WdAvPk.jpg",
|
||||
"https://i.imgur.com/RFSSvbE.jpg",
|
||||
"https://i.imgur.com/Ih2Fbbh.png",
|
||||
"https://i.imgur.com/DcTADmq.jpg",
|
||||
"https://i.imgur.com/IQIMmZV.jpg",
|
||||
"https://i.imgur.com/zqXl6TB.gif",
|
||||
"https://i.imgur.com/otIT53z.jpg",
|
||||
"https://i.imgur.com/yvBlxxP.png",
|
||||
"https://i.imgur.com/2Kiz3Jq.jpg",
|
||||
"https://i.imgur.com/kG6Qp9U.jpg",
|
||||
"https://i.imgur.com/JK66QjX.jpg",
|
||||
"https://i.imgur.com/fFsF6m7.jpg",
|
||||
"https://i.imgur.com/YqZmeyA.jpg",
|
||||
"https://i.imgur.com/wTn8ohi.jpg",
|
||||
"https://i.imgur.com/a3rIasf.jpg",
|
||||
"https://i.imgur.com/09VUIGr.jpg"
|
||||
]
|
||||
@@ -1,5 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const nimbats = require('../../assets/json/fidget');
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class FidgetCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -13,7 +13,12 @@ module.exports = class FidgetCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say({ files: [nimbats[Math.floor(Math.random() * nimbats.length)]] });
|
||||
async run(msg) {
|
||||
try {
|
||||
const nimbat = await randomFromImgurAlbum('DuO1T');
|
||||
return msg.say({ files: [nimbat] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const pikachus = require('../../assets/json/pikachu');
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class PikachuCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -13,7 +13,12 @@ module.exports = class PikachuCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say({ files: [pikachus[Math.floor(Math.random() * pikachus.length)]] });
|
||||
async run(msg) {
|
||||
try {
|
||||
const pikachu = await randomFromImgurAlbum('qtk2J');
|
||||
return msg.say({ files: [pikachu] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const xiaos = require('../../assets/json/xiao');
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class XiaoCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -13,7 +13,12 @@ module.exports = class XiaoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
return msg.say({ files: [xiaos[Math.floor(Math.random() * xiaos.length)]] });
|
||||
async run(msg) {
|
||||
try {
|
||||
const xiao = await randomFromImgurAlbum('S4e3r');
|
||||
return msg.say({ files: [xiao] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/1e6QRWk.gif',
|
||||
'https://i.imgur.com/hyteoA9.gif',
|
||||
'https://i.imgur.com/wT6357t.gif',
|
||||
'https://i.imgur.com/gyewxtI.gif',
|
||||
'https://i.imgur.com/rjcbrWc.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class BreakUpCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -26,10 +19,12 @@ module.exports = class BreakUpCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** breaks up with **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('QFWUb');
|
||||
return msg.say(`_**${msg.author.username}** breaks up with **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/JbkXFWy.gif',
|
||||
'https://i.imgur.com/LEVJfhI.gif',
|
||||
'https://i.imgur.com/WaJDnnS.gif',
|
||||
'https://i.imgur.com/wu4Xkpg.gif',
|
||||
'https://i.imgur.com/yAqf997.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class CuddleCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,10 +18,12 @@ module.exports = class CuddleCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** cuddles with **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('sVjXp');
|
||||
return msg.say(`_**${msg.author.username}** cuddles with **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/lQVyPgp.gif',
|
||||
'https://i.imgur.com/rWal7zB.gif',
|
||||
'https://i.imgur.com/DjURkgJ.gif',
|
||||
'https://i.imgur.com/NDvu9Ga.gif',
|
||||
'https://i.imgur.com/DAmSe54.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class EatCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,10 +18,12 @@ module.exports = class EatCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** eats **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('GP2zD');
|
||||
return msg.say(`_**${msg.author.username}** eats **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/bWJR9Ob.gif',
|
||||
'https://i.imgur.com/xW2p3BU.gif',
|
||||
'https://i.imgur.com/cMbUiPq.gif',
|
||||
'https://i.imgur.com/r1pvaH0.gif',
|
||||
'https://i.imgur.com/kWnkgI8.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class EvolveCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,10 +18,12 @@ module.exports = class EvolveCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${user.username}** is evolving!_
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('QaDeO');
|
||||
return msg.say(`_**${user.username}** is evolving!_`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/womEZVC.gif',
|
||||
'https://i.imgur.com/uw3S3hq.gif',
|
||||
'https://i.imgur.com/CVPT9ii.gif',
|
||||
'https://i.imgur.com/wGmUAIA.gif',
|
||||
'https://i.imgur.com/2HEhWdv.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class FalconPunchCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,10 +18,12 @@ module.exports = class FalconPunchCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** falcon punches **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('mJauN');
|
||||
return msg.say(`_**${msg.author.username}** falcon punches **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/VmawTx2.gif',
|
||||
'https://i.imgur.com/63KDI7Z.gif',
|
||||
'https://i.imgur.com/MUwliFW.gif',
|
||||
'https://i.imgur.com/DXQ1WPq.gif',
|
||||
'https://i.imgur.com/VzhQN0F.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class FistBumpCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,10 +18,12 @@ module.exports = class FistBumpCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** fist-bumps **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('9D3WE');
|
||||
return msg.say(`_**${msg.author.username}** fist-bumps **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/YvbhAML.gif',
|
||||
'https://i.imgur.com/LOWtASy.gif',
|
||||
'https://i.imgur.com/LgtJwPW.gif',
|
||||
'https://i.imgur.com/GuLDF6b.gif',
|
||||
'https://i.imgur.com/2DdIR5H.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class HighFiveCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,10 +18,12 @@ module.exports = class HighFiveCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** high-fives **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('1Dotc');
|
||||
return msg.say(`_**${msg.author.username}** high-fives **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class HitWithShovelCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -18,10 +18,12 @@ module.exports = class HitWithShovelCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** hits **${user.username}** with a shovel._
|
||||
https://i.imgur.com/XDIUq02.gif
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('IA35f');
|
||||
return msg.say(`_**${msg.author.username}** hits **${user.username}** with a shovel._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/yb29pZP.gif',
|
||||
'https://i.imgur.com/uLL4nHN.gif',
|
||||
'https://i.imgur.com/4pWi9tx.gif',
|
||||
'https://i.imgur.com/2BiHTef.gif',
|
||||
'https://i.imgur.com/lSyjOHL.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class HugCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,10 +18,12 @@ module.exports = class HugCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** hugs **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('v4Sdd');
|
||||
return msg.say(`_**${msg.author.username}** hugs **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
+11
-13
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/uUUk2kS.gif',
|
||||
'https://i.imgur.com/7C2v3yS.gif',
|
||||
'https://i.imgur.com/zsuMeQQ.gif',
|
||||
'https://i.imgur.com/kiqXxB6.gif',
|
||||
'https://i.imgur.com/0cK6zPg.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class InhaleCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,10 +18,15 @@ module.exports = class InhaleCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** inhales **${user.username}** but gained no ability..._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('QKFM6');
|
||||
return msg.say(
|
||||
`_**${msg.author.username}** inhales **${user.username}** but gained no ability..._`,
|
||||
{ files: [gif] }
|
||||
);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class KillCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -18,10 +18,12 @@ module.exports = class KillCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** kills **${user.username}**._
|
||||
https://i.imgur.com/KqWkaTf.gif
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('YhwEI');
|
||||
return msg.say(`_**${msg.author.username}** kills **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/Omge3Sb.gif',
|
||||
'https://i.imgur.com/KbfdOol.gif',
|
||||
'https://i.imgur.com/mWJAkhD.gif',
|
||||
'https://i.imgur.com/14j8ZkP.gif',
|
||||
'https://i.imgur.com/IXx6GyJ.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class KissCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,10 +18,12 @@ module.exports = class KissCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** kisses **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('twIbD');
|
||||
return msg.say(`_**${msg.author.username}** kisses **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/uz4k1qI.gif',
|
||||
'https://i.imgur.com/jSlUKbw.gif',
|
||||
'https://i.imgur.com/4LMEw0M.gif',
|
||||
'https://i.imgur.com/BbXQqn1.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class MarryCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -24,10 +18,12 @@ module.exports = class MarryCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** marries **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('4H0EP');
|
||||
return msg.say(`_**${msg.author.username}** marries **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/vNEN1CC.gif',
|
||||
'https://i.imgur.com/iWC1ZLa.gif',
|
||||
'https://i.imgur.com/APxZpnT.gif',
|
||||
'https://i.imgur.com/uwbx4lE.gif',
|
||||
'https://i.imgur.com/p0AzUqV.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class PatCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,10 +18,12 @@ module.exports = class PatCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** pats **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('JPwZG');
|
||||
return msg.say(`_**${msg.author.username}** pats **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/argcQ0p.gif',
|
||||
'https://i.imgur.com/2QnSTJv.gif',
|
||||
'https://i.imgur.com/W5ooaKk.gif',
|
||||
'https://i.imgur.com/kpGGGie.gif',
|
||||
'https://i.imgur.com/d35YfMo.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class PokeCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,10 +18,12 @@ module.exports = class PokeCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** pokes **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('ek91V');
|
||||
return msg.say(`_**${msg.author.username}** pokes **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/ihGcwnE.gif',
|
||||
'https://i.imgur.com/urpt2DJ.gif',
|
||||
'https://i.imgur.com/GbWuvMe.gif',
|
||||
'https://i.imgur.com/Txc5SoK.gif',
|
||||
'https://i.imgur.com/pzUmHEm.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class PunchCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,10 +18,12 @@ module.exports = class PunchCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** punches **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('mZrp8');
|
||||
return msg.say(`_**${msg.author.username}** punches **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/bNw8icN.gif',
|
||||
'https://i.imgur.com/wvQZQSs.gif',
|
||||
'https://i.imgur.com/ib0G51r.gif',
|
||||
'https://i.imgur.com/y7zW1gc.gif',
|
||||
'https://i.imgur.com/vHRiZDg.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class SlapCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -25,10 +18,12 @@ module.exports = class SlapCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** slaps **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('6wu9G');
|
||||
return msg.say(`_**${msg.author.username}** slaps **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const gifs = [
|
||||
'https://i.imgur.com/988Y889.gif',
|
||||
'https://i.imgur.com/wxnNRmS.gif',
|
||||
'https://i.imgur.com/FDvkjzn.gif',
|
||||
'https://i.imgur.com/CkHHmd7.gif',
|
||||
'https://i.imgur.com/Wispo2E.gif'
|
||||
];
|
||||
const { randomFromImgurAlbum } = require('../../util/Util');
|
||||
|
||||
module.exports = class TackleCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -26,10 +19,12 @@ module.exports = class TackleCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { user }) {
|
||||
return msg.say(stripIndents`
|
||||
_**${msg.author.username}** tackles **${user.username}**._
|
||||
${gifs[Math.floor(Math.random() * gifs.length)]}
|
||||
`);
|
||||
async run(msg, { user }) {
|
||||
try {
|
||||
const gif = await randomFromImgurAlbum('SZGLX');
|
||||
return msg.say(`_**${msg.author.username}** tackles **${user.username}**._`, { files: [gif] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "66.8.0",
|
||||
"version": "66.8.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
const snekfetch = require('snekfetch');
|
||||
const crypto = require('crypto');
|
||||
const { IMGUR_KEY } = process.env;
|
||||
const yes = ['yes', 'y', 'ye', 'yeah', 'yup', 'yea'];
|
||||
const no = ['no', 'n', 'nah', 'nope'];
|
||||
|
||||
@@ -60,6 +62,14 @@ class Util {
|
||||
return crypto.createHash(algorithm).update(text).digest('hex');
|
||||
}
|
||||
|
||||
static async randomFromImgurAlbum(album) {
|
||||
const { body } = await snekfetch
|
||||
.get(`https://api.imgur.com/3/album/${album}`)
|
||||
.set({ Authorization: `Client-ID ${IMGUR_KEY}` });
|
||||
if (!body.data.images.length) return null;
|
||||
return body.data.images[Math.floor(Math.random() * body.data.images.length)].link;
|
||||
}
|
||||
|
||||
static cleanXML(text) {
|
||||
return text
|
||||
.replace(/<br \/>/g, '')
|
||||
|
||||
Reference in New Issue
Block a user