diff --git a/assets/json/roman-numeral.json b/assets/json/roman-numeral.json index 5ec51c1f..e2136ba5 100644 --- a/assets/json/roman-numeral.json +++ b/assets/json/roman-numeral.json @@ -1,10 +1,4 @@ { - "M̅": 1000000, - "D̅": 500000, - "C̅": 100000, - "L̅": 50000, - "X̅": 10000, - "V̅": 5000, "M": 1000, "CM": 900, "D": 500, diff --git a/assets/json/soundboard.json b/assets/json/soundboard.json index f08f98fc..22ede927 100644 --- a/assets/json/soundboard.json +++ b/assets/json/soundboard.json @@ -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", diff --git a/assets/sounds/alarm.mp3 b/assets/sounds/alarm.mp3 new file mode 100644 index 00000000..220b938b Binary files /dev/null and b/assets/sounds/alarm.mp3 differ diff --git a/assets/sounds/car-crash.mp3 b/assets/sounds/car-crash.mp3 new file mode 100644 index 00000000..8d05ef42 Binary files /dev/null and b/assets/sounds/car-crash.mp3 differ diff --git a/commands/image-edit/demotivational-poster.js b/commands/image-edit/demotivational-poster.js index 9ed5a000..3407c78d 100644 --- a/commands/image-edit/demotivational-poster.js +++ b/commands/image-edit/demotivational-poster.js @@ -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!`); diff --git a/commands/number-edit/roman-numeral.js b/commands/number-edit/roman-numeral.js index 65a6936f..cfb3cb14 100644 --- a/commands/number-edit/roman-numeral.js +++ b/commands/number-edit/roman-numeral.js @@ -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 } ] }); diff --git a/commands/other/soundboard.js b/commands/other/soundboard.js index b305762c..4e14d314 100644 --- a/commands/other/soundboard.js +++ b/commands/other/soundboard.js @@ -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.', diff --git a/commands/search/new-york-times.js b/commands/random/new-york-times.js similarity index 90% rename from commands/search/new-york-times.js rename to commands/random/new-york-times.js index 43186e17..d62a442c 100644 --- a/commands/search/new-york-times.js +++ b/commands/random/new-york-times.js @@ -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() diff --git a/commands/search/google.js b/commands/search/google.js index 51c54f10..a6ca2092 100644 --- a/commands/search/google.js +++ b/commands/search/google.js @@ -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.'; + } } ] }); diff --git a/commands/search/map.js b/commands/search/map.js index 7198f1bd..ed06266e 100644 --- a/commands/search/map.js +++ b/commands/search/map.js @@ -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.'; + } } ] }); diff --git a/commands/text-edit/latlmes.js b/commands/text-edit/latlmes.js index 077e230c..2c7d2f0f 100644 --- a/commands/text-edit/latlmes.js +++ b/commands/text-edit/latlmes.js @@ -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()) } ] diff --git a/commands/text-edit/lmgtfy.js b/commands/text-edit/lmgtfy.js index 58e22b39..5dbb4423 100644 --- a/commands/text-edit/lmgtfy.js +++ b/commands/text-edit/lmgtfy.js @@ -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) } ] diff --git a/package.json b/package.json index 083921d7..5a300212 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "66.4.2", + "version": "66.4.3", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {