This commit is contained in:
Daniel Odendahl Jr
2018-02-23 23:44:02 +00:00
parent 6daa2be8c4
commit 1274d34c6e
13 changed files with 28 additions and 19 deletions
-6
View File
@@ -1,10 +1,4 @@
{
"M̅": 1000000,
"D̅": 500000,
"C̅": 100000,
"L̅": 50000,
"X̅": 10000,
"V̅": 5000,
"M": 1000,
"CM": 900,
"D": 500,
+2
View File
@@ -1,6 +1,8 @@
{
"airhorn": "airhorn.mp3",
"alarm": "alarm.mp3",
"ayaya": "ayaya.mp3",
"car crash": "car-crash.mp3",
"cat": "cat.mp3",
"doh": "doh.mp3",
"dun-dun-dun": "dun-dun-dun.mp3",
Binary file not shown.
Binary file not shown.
+3 -2
View File
@@ -2,6 +2,7 @@ const { Command } = require('discord.js-commando');
const { createCanvas, loadImage, registerFont } = require('canvas');
const snekfetch = require('snekfetch');
const path = require('path');
const { shortenText } = require('../../util/Canvas');
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto-Regular.ttf'), { family: 'Noto' });
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto-CJK.otf'), { family: 'Noto' });
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto-Emoji.ttf'), { family: 'Noto' });
@@ -56,10 +57,10 @@ module.exports = class DemotivationalPosterCommand extends Command {
ctx.textAlign = 'center';
ctx.font = '60px Noto';
ctx.fillStyle = 'aquamarine';
ctx.fillText(title, 375, 518);
ctx.fillText(shortenText(ctx, title, 610), 375, 518);
ctx.font = '27px Noto';
ctx.fillStyle = 'white';
ctx.fillText(text, 375, 565);
ctx.fillText(shortenText(ctx, text, 610), 375, 565);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'demotivational-poster.png' }] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+1 -1
View File
@@ -15,7 +15,7 @@ module.exports = class RomanNumeralCommand extends Command {
prompt: 'What number would you like to convert to roman numerals?',
type: 'integer',
min: 0,
max: 4999999
max: 4999
}
]
});
+1 -1
View File
@@ -7,7 +7,7 @@ module.exports = class SoundboardCommand extends Command {
constructor(client) {
super(client, {
name: 'soundboard',
aliases: ['sound'],
aliases: ['sound', 'foley'],
group: 'other',
memberName: 'soundboard',
description: 'Plays a sound in your voice channel.',
@@ -9,7 +9,7 @@ module.exports = class NewYorkTimesCommand extends Command {
super(client, {
name: 'new-york-times',
aliases: ['ny-times', 'new-york-times-article', 'ny-times-article'],
group: 'search',
group: 'random',
memberName: 'new-york-times',
description: 'Searches the New York Times for your query.',
clientPermissions: ['EMBED_LINKS'],
@@ -17,7 +17,8 @@ module.exports = class NewYorkTimesCommand extends Command {
{
key: 'query',
prompt: 'What do you want to search for articles about?',
type: 'string'
type: 'string',
default: ''
}
]
});
@@ -25,13 +26,14 @@ module.exports = class NewYorkTimesCommand extends Command {
async run(msg, { query }) {
try {
const { body } = await snekfetch
const fetch = snekfetch
.get('https://api.nytimes.com/svc/search/v2/articlesearch.json')
.query({
q: query,
'api-key': NYTIMES_KEY,
sort: 'newest'
});
if (query) fetch.query({ q: query });
const { body } = await fetch;
if (!body.response.docs.length) return msg.say('Could not find any results');
const data = body.response.docs[Math.floor(Math.random() * body.response.docs.length)];
const embed = new MessageEmbed()
+4 -1
View File
@@ -15,7 +15,10 @@ module.exports = class GoogleCommand extends Command {
key: 'query',
prompt: 'What would you like to search for?',
type: 'string',
max: 1000
validate: query => {
if (encodeURIComponent(query).length < 1973) return true;
return 'Invalid query, your query is too long.';
}
}
]
});
+5 -1
View File
@@ -23,7 +23,11 @@ module.exports = class MapCommand extends Command {
{
key: 'location',
prompt: 'What location would you like to get a map of?',
type: 'string'
type: 'string',
validate: location => {
if (encodeURIComponent(location).length < 1965) return true;
return 'Invalid location, your location is too long.';
}
}
]
});
+1 -1
View File
@@ -19,7 +19,7 @@ module.exports = class LatlmesCommand extends Command {
key: 'query',
prompt: 'What would you like the link to display as?',
type: 'string',
max: 1000,
max: 500,
parse: query => encodeURIComponent(query.replace(/ /g, '-').toLowerCase())
}
]
+4 -1
View File
@@ -13,7 +13,10 @@ module.exports = class LMGTFYCommand extends Command {
key: 'query',
prompt: 'What would you like the link to search for?',
type: 'string',
max: 1950,
validate: query => {
if (encodeURIComponent(query).length < 1973) return true;
return 'Invalid query, your query is too long.';
},
parse: query => encodeURIComponent(query)
}
]
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "66.4.2",
"version": "66.4.3",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {