msg.say files, HTML

This commit is contained in:
Daniel Odendahl Jr
2017-05-16 03:27:31 +00:00
parent 9413bb3008
commit c08a69db7c
24 changed files with 54 additions and 93 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ module.exports = class YearsCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'az.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'az.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -45,7 +45,7 @@ module.exports = class BeautifulCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'grunkle.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'grunkle.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -48,7 +48,7 @@ module.exports = class BobRossCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'ross.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'ross.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -67,7 +67,7 @@ module.exports = class CardCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -47,7 +47,7 @@ module.exports = class GreyscaleCommand extends Command {
const avatarImg = await snekfetch.get(avatarURL);
avatar.src = avatarImg.body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'greyscale.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'greyscale.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -45,7 +45,7 @@ module.exports = class InvertCommand extends Command {
const avatarImg = await snekfetch.get(avatarURL);
avatar.src = avatarImg.body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'invert.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'invert.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -53,7 +53,7 @@ module.exports = class RIPCommand extends Command {
const avatarImg = await snekfetch.get(avatarURL);
avatar.src = avatarImg.body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -45,7 +45,7 @@ module.exports = class SimbaCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'simba.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'simba.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -49,7 +49,7 @@ module.exports = class SteamCardCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'card.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -51,7 +51,7 @@ module.exports = class TriggeredCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'triggered.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'triggered.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -43,7 +43,7 @@ module.exports = class WantedCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
avatar.src = body;
generate();
return msg.channel.send({ files: [{ attachment: canvas.toBuffer(), name: 'wanted.png' }] })
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'wanted.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say('An Error Occurred while creating the image.');
+1 -1
View File
@@ -41,7 +41,7 @@ module.exports = class MemeCommand extends Command {
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
return msg.say('This Command requires the `Attach Files` Permission.');
const { type, top, bottom } = args;
return msg.channel.send({ files: [`https://memegen.link/${type}/${top}/${bottom}.jpg`] })
return msg.say({ files: [`https://memegen.link/${type}/${top}/${bottom}.jpg`] })
.catch(err => msg.say(err));
}
};
+1 -1
View File
@@ -15,7 +15,7 @@ module.exports = class SpamCommand extends Command {
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: [path.join(__dirname, '..', '..', 'assets', 'images', 'spam.png')] })
return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', 'spam.png')] })
.catch(err => msg.say(err));
}
};
+1 -1
View File
@@ -19,7 +19,7 @@ module.exports = class CatCommand extends Command {
try {
const { body } = await snekfetch
.get('http://random.cat/meow');
return msg.channel.send({ files: [body.file] })
return msg.say({ files: [body.file] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say(err);
+1 -1
View File
@@ -18,7 +18,7 @@ module.exports = class DogCommand extends Command {
try {
const { body } = await snekfetch
.get('https://random.dog/woof.json');
return msg.channel.send({ files: [body.url] })
return msg.say({ files: [body.url] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say(err);
+1 -1
View File
@@ -17,7 +17,7 @@ module.exports = class XiaoCommand extends Command {
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
return msg.say('This Command requires the `Attach Files` Permission.');
const xiao = Math.floor(Math.random() * 10) + 1;
return msg.channel.send({ files: [path.join(__dirname, '..', '..', 'assets', 'images', `xiaopai${xiao}.png`)] })
return msg.say({ files: [path.join(__dirname, '..', '..', 'assets', 'images', `xiaopai${xiao}.png`)] })
.catch(err => msg.say(err));
}
};
+2 -2
View File
@@ -31,13 +31,13 @@ module.exports = class XKCDCommand extends Command {
try {
const current = await snekfetch
.get('https://xkcd.com/info.0.json');
if (type === 'today') return msg.channel.send({ files: [current.body.img] })
if (type === 'today') return msg.say({ files: [current.body.img] })
.catch(err => msg.say(err));
else {
const random = Math.floor(Math.random() * current.body.num) + 1;
const { body } = await snekfetch
.get(`https://xkcd.com/${random}/info.0.json`);
return msg.channel.send({ files: [body.img] })
return msg.say({ files: [body.img] })
.catch(err => msg.say(err));
}
} catch (err) {
+1 -1
View File
@@ -33,7 +33,7 @@ module.exports = class KonachanCommand extends Command {
limit: 1
});
if (!body.length) throw new Error('No Results.');
return msg.channel.send(query ? `Result for ${query}:` : 'Random Image:', { files: [`https:${body[0].file_url}`] })
return msg.say(query ? `Result for ${query}:` : 'Random Image:', { files: [`https:${body[0].file_url}`] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say(err);
+1 -1
View File
@@ -44,7 +44,7 @@ module.exports = class MapCommand extends Command {
size: '500x500',
key: GOOGLE_KEY
});
return msg.channel.send({ files: [{ attachment: body, name: 'map.png' }] })
return msg.say({ files: [{ attachment: body, name: 'map.png' }] })
.catch(err => msg.say(err));
} catch (err) {
return msg.say(err);
+5 -52
View File
@@ -6,66 +6,19 @@
font-size: 100%;
border-style: solid;
border-color: lime;
background-image: url("https://i.imgur.com/LJsgebW.jpg");
box-shadow: 10px 10px 5px #888888;
text-shadow: 2px 2px #3333ff;
}
</style>
<marquee behavior="scroll" direction="left">
<font size="25">XiaoBot, your personal server companion...</font>
XiaoBot, your personal server companion...
</marquee>
<center>
<a href="https://discord.gg/fqQF8mc"><img src="https://discordapp.com/api/guilds/252317073814978561/embed.png" alt="Discord Server"></img></a>
</center>
<h3></h3>
<div class="xiaobox">
<h2>Features</h2>
<ul>
<li>Cleverbot!</li>
<li>Avatar Image Editing, including Bob Ross, RIP, Wanted, Triggered, and more!</li>
<li>Profile Trading Cards, with random rarity!</li>
<li>Fun Games including Lottery, Math, Quiz, Rock Paper Scissors, Slots, and Typing!</li>
<li>Server and User Information!</li>
<li>Meme Generation!</li>
<li>Moderation Commands including Ban/Softban/Kick/Warn/Unban, Lockdown, and Prune, with Customizable Logging!</li>
<li>Currency and Temperature Conversion!</li>
<li>Tons of Secret Easter Eggs to discover!</li>
<li>Soundboard!</li>
<li>Calculator!</li>
<li>Strawpoll Generation!</li>
<li>Events that Happened today in history!</li>
<li>Would you rather questions!</li>
<li>Random Cats, Dogs, VOCALOID Songs, and Xiao Pai Images!</li>
<li>8 Ball, Magic Conch, Coin Flip, Choose, Random Member, and Roll!</li>
<li>Waifu and Ship Rating!</li>
<li>Random Roasts, Fortunes, and Compliments!</li>
<li>Random Fact Core Quotes!</li>
<li>Random Name Generation!</li>
<li>Random Anime Images (with NSFW)!</li>
<li>Roleplay Commands!</li>
<li>Search Various sites including:</li>
<ul>
<li>Google</li>
<li>Discord Bots</li>
<li>Yahoo Weather</li>
<li>IMDB</li>
<li>Google Maps</li>
<li>Neopet Images</li>
<li>Osu!</li>
<li>SoundCloud</li>
<li>Urban Dictionary</li>
<li>Wattpad</li>
<li>Wikipedia</li>
<li>YouTube</li>
<li>YuGiOh! Card Data</li>
<li>Konachan</li>
<li>My Anime List</li>
</ul>
<li>LMGTFY Link Generation!</li>
<li>Binary, Morse, Pirate, and Temmie Translators!</li>
<li>Cowsay, Embed, Reverse, Zalgo, and Upside Down Text!</li>
<li>Customizable Prefix!</li>
<li>Member Join/Leave Logging to a Customizable Channel, with a Customizable Message!</li>
<li>Customizable Staff Role able to use Mod Commands!</li>
<li>Optional "Single Role Mode" where only one role can use the bot's commands!</li>
<li>And so so so much more!</li>
</ul>
<font size="10">Cleverbot, Moderation, Site Searching, Soundboard, Avatar Editing, Meme Generator, Games, and more!</font>
</div>
</div>
+23 -19
View File
@@ -6,11 +6,14 @@
font-size: 100%;
border-style: solid;
border-color: lime;
background-image: url("https://i.imgur.com/LJsgebW.jpg");
box-shadow: 10px 10px 5px #888888;
text-shadow: 2px 2px #3333ff;
}
</style>
<div class="xiaobox">
<h2>Features</h2>
<ul>
<ol>
<li>Cleverbot!</li>
<li>Avatar Image Editing, including Bob Ross, RIP, Wanted, Triggered, and more!</li>
<li>Profile Trading Cards, with random rarity!</li>
@@ -32,25 +35,26 @@
<li>Random Fact Core Quotes!</li>
<li>Random Name Generation!</li>
<li>Random Anime Images (with NSFW)!</li>
<li>Random XKCD Comics!</li>
<li>Roleplay Commands!</li>
<li>Search Various sites including:</li>
<ul>
<li>Google</li>
<li>Discord Bots</li>
<li>Yahoo Weather</li>
<li>IMDB</li>
<li>Google Maps</li>
<li>Neopet Images</li>
<li>Osu!</li>
<li>SoundCloud</li>
<li>Urban Dictionary</li>
<li>Wattpad</li>
<li>Wikipedia</li>
<li>YouTube</li>
<li>YuGiOh! Card Data</li>
<li>Konachan</li>
<li>My Anime List</li>
</ul>
<ol>
<li>Google</li>
<li>Discord Bots</li>
<li>Yahoo Weather</li>
<li>IMDB</li>
<li>Google Maps</li>
<li>Neopet Images</li>
<li>Osu!</li>
<li>SoundCloud</li>
<li>Urban Dictionary</li>
<li>Wattpad</li>
<li>Wikipedia</li>
<li>YouTube</li>
<li>YuGiOh! Card Data</li>
<li>Konachan</li>
<li>My Anime List</li>
</ol>
<li>LMGTFY Link Generation!</li>
<li>Binary, Morse, Pirate, and Temmie Translators!</li>
<li>Cowsay, Embed, Reverse, Zalgo, and Upside Down Text!</li>
@@ -59,6 +63,6 @@
<li>Customizable Staff Role able to use Mod Commands!</li>
<li>Optional "Single Role Mode" where only one role can use the bot's commands!</li>
<li>And so so so much more!</li>
</ul>
</ol>
</div>
</div>
+3
View File
@@ -6,6 +6,9 @@
font-size: 100%;
border-style: solid;
border-color: lime;
background-image: url("https://i.imgur.com/LJsgebW.jpg");
box-shadow: 10px 10px 5px #888888;
text-shadow: 2px 2px #3333ff;
}
</style>
<div class="xiaobox">
+1
View File
@@ -30,6 +30,7 @@
<li>Random Fact Core Quotes!</li>
<li>Random Name Generation!</li>
<li>Random Anime Images (with NSFW)!</li>
<li>Random XKCD Comics!</li>
<li>Roleplay Commands!</li>
<li>Search Various sites including:</li>
<ul>
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "19.6.0",
"version": "19.6.2",
"description": "A Discord Bot",
"main": "shardingmanager.js",
"scripts": {
@@ -38,7 +38,7 @@
"cheerio": "^0.22.0",
"cleverio": "dragonfire535/cleverio",
"custom-translate": "dragonfire535/custom-translate",
"discord.js": "hydrabolt/discord.js#4422f2aa8a72ae8765d91c2b1847785992075c33",
"discord.js": "hydrabolt/discord.js",
"discord.js-commando": "gawdl3y/discord.js-commando",
"erlpack": "hammerandchisel/erlpack",
"mathjs": "^3.12.2",