Tsubaki, Native Image Reading
|
After Width: | Height: | Size: 271 KiB |
|
After Width: | Height: | Size: 301 KiB |
|
After Width: | Height: | Size: 554 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 368 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 875 KiB |
@@ -1,6 +1,9 @@
|
|||||||
const { Command } = require('discord.js-commando');
|
const { Command } = require('discord.js-commando');
|
||||||
const Canvas = require('canvas');
|
const Canvas = require('canvas');
|
||||||
const request = require('superagent');
|
const request = require('superagent');
|
||||||
|
const { promisifyAll } = require('tsubaki');
|
||||||
|
const fs = promisifyAll(require('fs'));
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = class YearsCommand extends Command {
|
module.exports = class YearsCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -37,11 +40,8 @@ module.exports = class YearsCommand extends Command {
|
|||||||
ctx.drawImage(base, 0, 0);
|
ctx.drawImage(base, 0, 0);
|
||||||
ctx.drawImage(avatar, 461, 127, 200, 200);
|
ctx.drawImage(avatar, 461, 127, 200, 200);
|
||||||
};
|
};
|
||||||
const azImg = await request
|
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', '3000years.png'));
|
||||||
.get('https://i.imgur.com/eScwGFS.png');
|
const avatarImg = await request.get(avatarURL);
|
||||||
const avatarImg = await request
|
|
||||||
.get(avatarURL);
|
|
||||||
base.src = azImg.body;
|
|
||||||
avatar.src = avatarImg.body;
|
avatar.src = avatarImg.body;
|
||||||
generate();
|
generate();
|
||||||
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'az.png' }] })
|
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'az.png' }] })
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
const { Command } = require('discord.js-commando');
|
const { Command } = require('discord.js-commando');
|
||||||
const Canvas = require('canvas');
|
const Canvas = require('canvas');
|
||||||
const request = require('superagent');
|
const request = require('superagent');
|
||||||
|
const { promisifyAll } = require('tsubaki');
|
||||||
|
const fs = promisifyAll(require('fs'));
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = class BeautifulCommand extends Command {
|
module.exports = class BeautifulCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -36,13 +39,10 @@ module.exports = class BeautifulCommand extends Command {
|
|||||||
const generate = () => {
|
const generate = () => {
|
||||||
ctx.drawImage(base, 0, 0);
|
ctx.drawImage(base, 0, 0);
|
||||||
ctx.drawImage(avatar, 341, 35, 117, 135);
|
ctx.drawImage(avatar, 341, 35, 117, 135);
|
||||||
ctx.drawImage(avatar, 342, 301, 117, 135);
|
ctx.drawImage(avatar, 342, 303, 117, 135);
|
||||||
};
|
};
|
||||||
const grunkleImg = await request
|
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'beautiful.png'));
|
||||||
.get('https://i.imgur.com/71qLwPf.png');
|
const avatarImg = await request.get(avatarURL);
|
||||||
const avatarImg = await request
|
|
||||||
.get(avatarURL);
|
|
||||||
base.src = grunkleImg.body;
|
|
||||||
avatar.src = avatarImg.body;
|
avatar.src = avatarImg.body;
|
||||||
generate();
|
generate();
|
||||||
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'grunkle.png' }] })
|
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'grunkle.png' }] })
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
const { Command } = require('discord.js-commando');
|
const { Command } = require('discord.js-commando');
|
||||||
const Canvas = require('canvas');
|
const Canvas = require('canvas');
|
||||||
const request = require('superagent');
|
const request = require('superagent');
|
||||||
|
const { promisifyAll } = require('tsubaki');
|
||||||
|
const fs = promisifyAll(require('fs'));
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = class BobRossCommand extends Command {
|
module.exports = class BobRossCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -41,11 +44,8 @@ module.exports = class BobRossCommand extends Command {
|
|||||||
ctx.rotate(-3 * Math.PI / 180);
|
ctx.rotate(-3 * Math.PI / 180);
|
||||||
ctx.drawImage(base, 0, 0);
|
ctx.drawImage(base, 0, 0);
|
||||||
};
|
};
|
||||||
const rossImg = await request
|
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'bobross.png'));
|
||||||
.get('https://i.imgur.com/7NSiFLd.png');
|
const avatarImg = await request.get(avatarURL);
|
||||||
const avatarImg = await request
|
|
||||||
.get(avatarURL);
|
|
||||||
base.src = rossImg.body;
|
|
||||||
avatar.src = avatarImg.body;
|
avatar.src = avatarImg.body;
|
||||||
generate();
|
generate();
|
||||||
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'ross.png' }] })
|
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'ross.png' }] })
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ const { Command } = require('discord.js-commando');
|
|||||||
const Canvas = require('canvas');
|
const Canvas = require('canvas');
|
||||||
const request = require('superagent');
|
const request = require('superagent');
|
||||||
const moment = require('moment');
|
const moment = require('moment');
|
||||||
|
const { promisifyAll } = require('tsubaki');
|
||||||
|
const fs = promisifyAll(require('fs'));
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { version } = require('../../package');
|
const { version } = require('../../package');
|
||||||
|
|
||||||
@@ -61,11 +63,8 @@ module.exports = class CardCommand extends Command {
|
|||||||
ctx.fillText(member.id, 30, 355);
|
ctx.fillText(member.id, 30, 355);
|
||||||
ctx.fillText(`#${member.user.discriminator}`, 313, 355);
|
ctx.fillText(`#${member.user.discriminator}`, 313, 355);
|
||||||
};
|
};
|
||||||
const cardImg = await request
|
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'card.png'));
|
||||||
.get('https://i.imgur.com/6j8RHk1.png');
|
const avatarImg = await request.get(avatarURL);
|
||||||
const avatarImg = await request
|
|
||||||
.get(avatarURL);
|
|
||||||
base.src = cardImg.body;
|
|
||||||
avatar.src = avatarImg.body;
|
avatar.src = avatarImg.body;
|
||||||
generate();
|
generate();
|
||||||
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] })
|
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] })
|
||||||
|
|||||||
@@ -44,8 +44,7 @@ module.exports = class GreyscaleCommand extends Command {
|
|||||||
}
|
}
|
||||||
ctx.putImageData(imgData, 0, 0);
|
ctx.putImageData(imgData, 0, 0);
|
||||||
};
|
};
|
||||||
const avatarImg = await request
|
const avatarImg = await request.get(avatarURL);
|
||||||
.get(avatarURL);
|
|
||||||
avatar.src = avatarImg.body;
|
avatar.src = avatarImg.body;
|
||||||
generate();
|
generate();
|
||||||
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'greyscale.png' }] })
|
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'greyscale.png' }] })
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ module.exports = class InvertCommand extends Command {
|
|||||||
}
|
}
|
||||||
ctx.putImageData(imgData, 0, 0);
|
ctx.putImageData(imgData, 0, 0);
|
||||||
};
|
};
|
||||||
const avatarImg = await request
|
const avatarImg = await request.get(avatarURL);
|
||||||
.get(avatarURL);
|
|
||||||
avatar.src = avatarImg.body;
|
avatar.src = avatarImg.body;
|
||||||
generate();
|
generate();
|
||||||
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'invert.png' }] })
|
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'invert.png' }] })
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
const { Command } = require('discord.js-commando');
|
const { Command } = require('discord.js-commando');
|
||||||
const Canvas = require('canvas');
|
const Canvas = require('canvas');
|
||||||
const request = require('superagent');
|
const request = require('superagent');
|
||||||
|
const { promisifyAll } = require('tsubaki');
|
||||||
|
const fs = promisifyAll(require('fs'));
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = class RIPCommand extends Command {
|
module.exports = class RIPCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -46,11 +49,8 @@ module.exports = class RIPCommand extends Command {
|
|||||||
}
|
}
|
||||||
ctx.putImageData(imgData, 158, 51);
|
ctx.putImageData(imgData, 158, 51);
|
||||||
};
|
};
|
||||||
const ripImg = await request
|
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'rip.png'));
|
||||||
.get('https://i.imgur.com/Gbu1B2m.png');
|
const avatarImg = await request.get(avatarURL);
|
||||||
const avatarImg = await request
|
|
||||||
.get(avatarURL);
|
|
||||||
base.src = ripImg.body;
|
|
||||||
avatar.src = avatarImg.body;
|
avatar.src = avatarImg.body;
|
||||||
generate();
|
generate();
|
||||||
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] })
|
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] })
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
const { Command } = require('discord.js-commando');
|
const { Command } = require('discord.js-commando');
|
||||||
const Canvas = require('canvas');
|
const Canvas = require('canvas');
|
||||||
const request = require('superagent');
|
const request = require('superagent');
|
||||||
|
const { promisifyAll } = require('tsubaki');
|
||||||
|
const fs = promisifyAll(require('fs'));
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = class SteamCardCommand extends Command {
|
module.exports = class SteamCardCommand extends Command {
|
||||||
@@ -43,11 +45,8 @@ module.exports = class SteamCardCommand extends Command {
|
|||||||
ctx.font = '30px Open Sans';
|
ctx.font = '30px Open Sans';
|
||||||
ctx.fillText(username, 35, 48);
|
ctx.fillText(username, 35, 48);
|
||||||
};
|
};
|
||||||
const cardImg = await request
|
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'steamcard.png'));
|
||||||
.get('https://i.imgur.com/JF0WwQX.png');
|
const avatarImg = await request.get(avatarURL);
|
||||||
const avatarImg = await request
|
|
||||||
.get(avatarURL);
|
|
||||||
base.src = cardImg.body;
|
|
||||||
avatar.src = avatarImg.body;
|
avatar.src = avatarImg.body;
|
||||||
generate();
|
generate();
|
||||||
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] })
|
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] })
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
const { Command } = require('discord.js-commando');
|
const { Command } = require('discord.js-commando');
|
||||||
const Canvas = require('canvas');
|
const Canvas = require('canvas');
|
||||||
const request = require('superagent');
|
const request = require('superagent');
|
||||||
|
const { promisifyAll } = require('tsubaki');
|
||||||
|
const fs = promisifyAll(require('fs'));
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = class TriggeredCommand extends Command {
|
module.exports = class TriggeredCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -44,11 +47,8 @@ module.exports = class TriggeredCommand extends Command {
|
|||||||
ctx.putImageData(imgData, 0, 0);
|
ctx.putImageData(imgData, 0, 0);
|
||||||
ctx.drawImage(base, 0, 0);
|
ctx.drawImage(base, 0, 0);
|
||||||
};
|
};
|
||||||
const triggeredImg = await request
|
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'triggered.png'));
|
||||||
.get('https://i.imgur.com/tF9yF62.png');
|
const avatarImg = await request.get(avatarURL);
|
||||||
const avatarImg = await request
|
|
||||||
.get(avatarURL);
|
|
||||||
base.src = triggeredImg.body;
|
|
||||||
avatar.src = avatarImg.body;
|
avatar.src = avatarImg.body;
|
||||||
generate();
|
generate();
|
||||||
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'triggered.png' }] })
|
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'triggered.png' }] })
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
const { Command } = require('discord.js-commando');
|
const { Command } = require('discord.js-commando');
|
||||||
const Canvas = require('canvas');
|
const Canvas = require('canvas');
|
||||||
const request = require('superagent');
|
const request = require('superagent');
|
||||||
|
const { promisifyAll } = require('tsubaki');
|
||||||
|
const fs = promisifyAll(require('fs'));
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = class WantedCommand extends Command {
|
module.exports = class WantedCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -36,11 +39,8 @@ module.exports = class WantedCommand extends Command {
|
|||||||
ctx.drawImage(base, 0, 0);
|
ctx.drawImage(base, 0, 0);
|
||||||
ctx.drawImage(avatar, 150, 360, 430, 430);
|
ctx.drawImage(avatar, 150, 360, 430, 430);
|
||||||
};
|
};
|
||||||
const wantedImg = await request
|
base.src = await fs.readFileAsync(path.join(__dirname, '..', '..', 'assets', 'images', 'wanted.png'));
|
||||||
.get('https://i.imgur.com/6bBDfsO.png');
|
const avatarImg = await request.get(avatarURL);
|
||||||
const avatarImg = await request
|
|
||||||
.get(avatarURL);
|
|
||||||
base.src = wantedImg.body;
|
|
||||||
avatar.src = avatarImg.body;
|
avatar.src = avatarImg.body;
|
||||||
generate();
|
generate();
|
||||||
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'wanted.png' }] })
|
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'wanted.png' }] })
|
||||||
|
|||||||
@@ -44,8 +44,7 @@ module.exports = class CurrencyCommand extends Command {
|
|||||||
const { base, to, amount } = args;
|
const { base, to, amount } = args;
|
||||||
if (base === to) return msg.say(`Converting ${base} to ${to} is the same value, dummy.`);
|
if (base === to) return msg.say(`Converting ${base} to ${to} is the same value, dummy.`);
|
||||||
try {
|
try {
|
||||||
const { body } = await request
|
const { body } = await request.get(`http://api.fixer.io/latest?base=${base}&symbols=${to}`);
|
||||||
.get(`http://api.fixer.io/latest?base=${base}&symbols=${to}`);
|
|
||||||
const rate = body.rates[to];
|
const rate = body.rates[to];
|
||||||
return msg.say(`${amount} ${base} is ${amount * rate} ${to}.`);
|
return msg.say(`${amount} ${base} is ${amount * rate} ${to}.`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -11,9 +11,6 @@ module.exports = class SpamCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run(msg) {
|
run(msg) {
|
||||||
if (msg.channel.type !== 'dm')
|
|
||||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
|
||||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
|
||||||
return msg.channel.send({ files: ['https://i.imgur.com/2JFu5xE.jpg'] })
|
return msg.channel.send({ files: ['https://i.imgur.com/2JFu5xE.jpg'] })
|
||||||
.catch(err => msg.say(err));
|
.catch(err => msg.say(err));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ module.exports = class CatCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async run(msg) {
|
async run(msg) {
|
||||||
if (msg.channel.type !== 'dm')
|
|
||||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
|
||||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
|
||||||
try {
|
try {
|
||||||
const { body } = await request
|
const { body } = await request
|
||||||
.get('http://random.cat/meow');
|
.get('http://random.cat/meow');
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ module.exports = class DogCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async run(msg) {
|
async run(msg) {
|
||||||
if (msg.channel.type !== 'dm')
|
|
||||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
|
||||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
|
||||||
try {
|
try {
|
||||||
const { body } = await request
|
const { body } = await request
|
||||||
.get('https://random.dog/woof.json');
|
.get('https://random.dog/woof.json');
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ module.exports = class XiaoCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run(msg) {
|
run(msg) {
|
||||||
if (msg.channel.type !== 'dm')
|
|
||||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
|
||||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
|
||||||
const xiao = xiaos[Math.floor(Math.random() * xiaos.length)];
|
const xiao = xiaos[Math.floor(Math.random() * xiaos.length)];
|
||||||
return msg.channel.send({ files: [xiao] })
|
return msg.channel.send({ files: [xiao] })
|
||||||
.catch(err => msg.say(err));
|
.catch(err => msg.say(err));
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ module.exports = class BotSearchCommand extends Command {
|
|||||||
.set({ 'Authorization': DISCORD_BOTS_KEY });
|
.set({ 'Authorization': DISCORD_BOTS_KEY });
|
||||||
const embed = new RichEmbed()
|
const embed = new RichEmbed()
|
||||||
.setColor(0x9797FF)
|
.setColor(0x9797FF)
|
||||||
.setAuthor('Discord Bots', 'https://i.imgur.com/lrKYBQi.jpg')
|
.setAuthor('Discord Bots')
|
||||||
.setTitle(body.name)
|
.setTitle(body.name)
|
||||||
.setURL(`https://bots.discord.pw/bots/${bot.id}`)
|
.setURL(`https://bots.discord.pw/bots/${bot.id}`)
|
||||||
.setDescription(body.description)
|
.setDescription(body.description)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ module.exports = class ForecastCommand extends Command {
|
|||||||
const forecasts = body.query.results.channel.item.forecast;
|
const forecasts = body.query.results.channel.item.forecast;
|
||||||
const embed = new RichEmbed()
|
const embed = new RichEmbed()
|
||||||
.setColor(0x0000FF)
|
.setColor(0x0000FF)
|
||||||
.setAuthor(body.query.results.channel.title, 'https://i.imgur.com/2MT0ViC.png')
|
.setAuthor(body.query.results.channel.title)
|
||||||
.setURL(body.query.results.channel.link)
|
.setURL(body.query.results.channel.link)
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.addField(`**${forecasts[0].day} - ${forecasts[0].date}:**`,
|
.addField(`**${forecasts[0].day} - ${forecasts[0].date}:**`,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ module.exports = class IMDBCommand extends Command {
|
|||||||
if (body.Error) throw new Error('No Results.');
|
if (body.Error) throw new Error('No Results.');
|
||||||
const embed = new RichEmbed()
|
const embed = new RichEmbed()
|
||||||
.setColor(0xDBA628)
|
.setColor(0xDBA628)
|
||||||
.setAuthor('IMDB', 'https://i.imgur.com/sXwwIQs.png')
|
.setAuthor('IMDB')
|
||||||
.setURL(`http://www.imdb.com/title/${body.imdbID}`)
|
.setURL(`http://www.imdb.com/title/${body.imdbID}`)
|
||||||
.setTitle(`${body.Title} (${body.imdbRating} Score)`)
|
.setTitle(`${body.Title} (${body.imdbRating} Score)`)
|
||||||
.setDescription(body.Plot.substr(0, 2000))
|
.setDescription(body.Plot.substr(0, 2000))
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ module.exports = class OsuCommand extends Command {
|
|||||||
if (!body.length) throw new Error('No Results.');
|
if (!body.length) throw new Error('No Results.');
|
||||||
const embed = new RichEmbed()
|
const embed = new RichEmbed()
|
||||||
.setColor(0xFF66AA)
|
.setColor(0xFF66AA)
|
||||||
.setAuthor('osu!', 'https://i.imgur.com/EmnUp00.png')
|
.setAuthor('osu!')
|
||||||
.setURL('https://osu.ppy.sh/')
|
.setURL('https://osu.ppy.sh/')
|
||||||
.addField('**Username:**',
|
.addField('**Username:**',
|
||||||
body[0].username, true)
|
body[0].username, true)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ module.exports = class SoundCloudCommand extends Command {
|
|||||||
if (!body.length) throw new Error('No Results.');
|
if (!body.length) throw new Error('No Results.');
|
||||||
const embed = new RichEmbed()
|
const embed = new RichEmbed()
|
||||||
.setColor(0xF15A22)
|
.setColor(0xF15A22)
|
||||||
.setAuthor(body[0].title, 'https://i.imgur.com/lFIz7RU.png')
|
.setAuthor(body[0].title)
|
||||||
.setURL(body[0].permalink_url)
|
.setURL(body[0].permalink_url)
|
||||||
.setThumbnail(body[0].artwork_url)
|
.setThumbnail(body[0].artwork_url)
|
||||||
.addField('**Artist:**',
|
.addField('**Artist:**',
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ module.exports = class UrbanCommand extends Command {
|
|||||||
if (!body.list.length) throw new Error('No Results.');
|
if (!body.list.length) throw new Error('No Results.');
|
||||||
const embed = new RichEmbed()
|
const embed = new RichEmbed()
|
||||||
.setColor(0x32a8f0)
|
.setColor(0x32a8f0)
|
||||||
.setAuthor('Urban Dictionary', 'https://i.imgur.com/fzFuuL7.png')
|
.setAuthor('Urban Dictionary')
|
||||||
.setURL(body.list[0].permalink)
|
.setURL(body.list[0].permalink)
|
||||||
.setTitle(body.list[0].word)
|
.setTitle(body.list[0].word)
|
||||||
.setDescription(body.list[0].definition.substr(0, 2000))
|
.setDescription(body.list[0].definition.substr(0, 2000))
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ module.exports = class WattpadCommand extends Command {
|
|||||||
if (!body.stories.length) throw new Error('No Results.');
|
if (!body.stories.length) throw new Error('No Results.');
|
||||||
const embed = new RichEmbed()
|
const embed = new RichEmbed()
|
||||||
.setColor(0xF89C34)
|
.setColor(0xF89C34)
|
||||||
.setAuthor('Wattpad', 'https://i.imgur.com/Rw9vRQB.png')
|
.setAuthor('Wattpad')
|
||||||
.setURL(body.stories[0].url)
|
.setURL(body.stories[0].url)
|
||||||
.setTitle(body.stories[0].title)
|
.setTitle(body.stories[0].title)
|
||||||
.setDescription(body.stories[0].description.substr(0, 2000))
|
.setDescription(body.stories[0].description.substr(0, 2000))
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ module.exports = class WeatherCommand extends Command {
|
|||||||
if (!body.query.count) throw new Error('Location Not Found.');
|
if (!body.query.count) throw new Error('Location Not Found.');
|
||||||
const embed = new RichEmbed()
|
const embed = new RichEmbed()
|
||||||
.setColor(0x0000FF)
|
.setColor(0x0000FF)
|
||||||
.setAuthor(body.query.results.channel.title, 'https://i.imgur.com/2MT0ViC.png')
|
.setAuthor(body.query.results.channel.title)
|
||||||
.setURL(body.query.results.channel.link)
|
.setURL(body.query.results.channel.link)
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.addField('**City:**',
|
.addField('**City:**',
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ module.exports = class WikipediaCommand extends Command {
|
|||||||
.setColor(0xE7E7E7)
|
.setColor(0xE7E7E7)
|
||||||
.setTitle(body.query.pages[0].title)
|
.setTitle(body.query.pages[0].title)
|
||||||
.setURL(`https://en.wikipedia.org/wiki/${query}`)
|
.setURL(`https://en.wikipedia.org/wiki/${query}`)
|
||||||
.setAuthor('Wikipedia', 'https://i.imgur.com/a4eeEhh.png')
|
.setAuthor('Wikipedia')
|
||||||
.setDescription(body.query.pages[0].extract.substr(0, 2000).replace(/[\n]/g, '\n\n'));
|
.setDescription(body.query.pages[0].extract.substr(0, 2000).replace(/[\n]/g, '\n\n'));
|
||||||
return msg.embed(embed);
|
return msg.embed(embed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ module.exports = class YouTubeCommand extends Command {
|
|||||||
.setColor(0xDD2825)
|
.setColor(0xDD2825)
|
||||||
.setTitle(body.items[0].snippet.title)
|
.setTitle(body.items[0].snippet.title)
|
||||||
.setDescription(body.items[0].snippet.description)
|
.setDescription(body.items[0].snippet.description)
|
||||||
.setAuthor(`YouTube - ${body.items[0].snippet.channelTitle}`, 'https://i.imgur.com/hkUafwu.png')
|
.setAuthor(`YouTube - ${body.items[0].snippet.channelTitle}`)
|
||||||
.setURL(`https://www.youtube.com/watch?v=${body.items[0].id.videoId}`)
|
.setURL(`https://www.youtube.com/watch?v=${body.items[0].id.videoId}`)
|
||||||
.setThumbnail(body.items[0].snippet.thumbnails.default.url);
|
.setThumbnail(body.items[0].snippet.thumbnails.default.url);
|
||||||
return msg.embed(embed);
|
return msg.embed(embed);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ module.exports = class YuGiOhCommand extends Command {
|
|||||||
.setColor(0xBE5F1F)
|
.setColor(0xBE5F1F)
|
||||||
.setTitle(body.data.name)
|
.setTitle(body.data.name)
|
||||||
.setDescription(body.data.text)
|
.setDescription(body.data.text)
|
||||||
.setAuthor('Yu-Gi-Oh!', 'https://i.imgur.com/7gPm9Rr.png')
|
.setAuthor('Yu-Gi-Oh!')
|
||||||
.addField('**Card Type:**',
|
.addField('**Card Type:**',
|
||||||
body.data.card_type, true)
|
body.data.card_type, true)
|
||||||
.addField('**Type:**',
|
.addField('**Type:**',
|
||||||
|
|||||||
@@ -57,12 +57,12 @@ module.exports = class UserInfoCommand extends Command {
|
|||||||
member.id, true)
|
member.id, true)
|
||||||
.addField('**Joined Discord On:**',
|
.addField('**Joined Discord On:**',
|
||||||
stripIndents`
|
stripIndents`
|
||||||
${moment(member.user.createdTimestamp).format('MMMM Do YYYY h:mm:ss a')}
|
${moment(member.user.createdTimestamp).format('MMMM Do YYYY h:mm:ss A')}
|
||||||
${moment.duration(Date.now() - member.user.createdTimestamp).format('y[ years], M[ months], w[ weeks, and ]d[ days]')} ago.
|
${moment.duration(Date.now() - member.user.createdTimestamp).format('y[ years], M[ months], w[ weeks, and ]d[ days]')} ago.
|
||||||
`)
|
`)
|
||||||
.addField('**Joined Server On:**',
|
.addField('**Joined Server On:**',
|
||||||
stripIndents`
|
stripIndents`
|
||||||
${moment(member.joinedTimestamp).format('MMMM Do YYYY h:mm:ss a')}
|
${moment(member.joinedTimestamp).format('MMMM Do YYYY h:mm:ss A')}
|
||||||
${moment.duration(Date.now() - member.joinedTimestamp).format('y[ years], M[ months], w[ weeks, and ]d[ days]')} ago.
|
${moment.duration(Date.now() - member.joinedTimestamp).format('y[ years], M[ months], w[ weeks, and ]d[ days]')} ago.
|
||||||
`)
|
`)
|
||||||
.addField('**Status:**',
|
.addField('**Status:**',
|
||||||
|
|||||||
@@ -58,7 +58,8 @@ module.exports = class InfoCommand extends Command {
|
|||||||
[canvas](https://github.com/Automattic/node-canvas),
|
[canvas](https://github.com/Automattic/node-canvas),
|
||||||
[cheerio](https://cheerio.js.org),
|
[cheerio](https://cheerio.js.org),
|
||||||
[sequelize](http://docs.sequelizejs.com),
|
[sequelize](http://docs.sequelizejs.com),
|
||||||
[pg](https://github.com/brianc/node-postgres)
|
[pg](https://github.com/brianc/node-postgres),
|
||||||
|
[tsubaki](https://github.com/iCrawl/tsubaki)
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
.addField('APIs',
|
.addField('APIs',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaobot",
|
"name": "xiaobot",
|
||||||
"version": "19.2.2",
|
"version": "19.2.3",
|
||||||
"description": "A Discord Bot",
|
"description": "A Discord Bot",
|
||||||
"main": "shardingmanager.js",
|
"main": "shardingmanager.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -44,6 +44,7 @@
|
|||||||
"pg": "^6.1.5",
|
"pg": "^6.1.5",
|
||||||
"sequelize": "^3.30.4",
|
"sequelize": "^3.30.4",
|
||||||
"superagent": "^3.5.2",
|
"superagent": "^3.5.2",
|
||||||
|
"tsubaki": "^1.1.0",
|
||||||
"zalgolize": "^1.2.4"
|
"zalgolize": "^1.2.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||