Master to master

This commit is contained in:
CyndaquilDAC 2020-06-15 15:56:51 +00:00 committed by Loïc Bersier
parent fd173b3653
commit 7c5cc62c64
7 changed files with 21 additions and 21 deletions

View file

@ -16,13 +16,13 @@ class FourchanCommand extends Command {
id: 'board', id: 'board',
type: 'string', type: 'string',
prompt: { prompt: {
start: 'which board do you want to browse?', start: 'Which board do you want to browse?',
}, },
match: 'rest' match: 'rest'
} }
], ],
description: { description: {
content: 'Send random images from a 4chan board of your choosing', content: 'Send random images from a 4chan board of your choosing!',
usage: '[board]', usage: '[board]',
examples: ['vg'] examples: ['vg']
} }
@ -30,7 +30,7 @@ class FourchanCommand extends Command {
} }
async exec(message, args) { async exec(message, args) {
if (boards.getType(args.board) === boards.NSFW && !message.channel.nsfw) return message.channel.send('Sorry, this board only work in nsfw channel!'); if (boards.getType(args.board) === boards.NSFW && !message.channel.nsfw) return message.channel.send('Sorry, this board only works in nsfw channels!');
if (!args.board) return; if (!args.board) return;
args.board = args.board.replace(/\//g, ''); args.board = args.board.replace(/\//g, '');
@ -42,7 +42,7 @@ class FourchanCommand extends Command {
return response.json(); return response.json();
}).then((response) => { }).then((response) => {
if (!response.threads) if (!response.threads)
return message.channel.send('Not a valid board'); return message.channel.send('Not a valid board! Try again!');
i = Math.floor((Math.random() * response.threads.length) + 1); i = Math.floor((Math.random() * response.threads.length) + 1);
@ -88,9 +88,9 @@ class FourchanCommand extends Command {
} }
}) })
.catch((err) => { .catch((err) => {
if (err.type == 'invalid-json') return message.channel.send('Could not find the board'); if (err.type == 'invalid-json') return message.channel.send('Could not find the board! Try again!');
console.error(err); console.error(err);
return message.channel.send('Uh-oh, an error has occured and i don\'t know why!'); return message.channel.send('Uh-oh, an error has occured! Try again! If this keeps happening, tell the developers!');
}); });
} }
} }

View file

@ -17,7 +17,7 @@ class asciifyCommand extends Command {
cooldown: 600000, cooldown: 600000,
ratelimit: 2, ratelimit: 2,
description: { description: {
content: 'Transform your image into ascii (ATTENTION, SPAM!)', content: 'Transform your image into ASCII! (This can be a bit spammy, so be careful!)',
usage: '[image in attachment]', usage: '[image in attachment]',
examples: ['image in attachment'] examples: ['image in attachment']
} }

View file

@ -23,7 +23,7 @@ class audio2imageCommand extends Command {
} }
], ],
description: { description: {
content: 'Transform audio file into image. --size (a number) to get a bigger image NOTE: bigger image might fail ', content: 'Transform an audio file into an image.Use --size (a number) to get a bigger image! (NOTE: bigger image might fail, so be careful!)',
usage: '[link to audio] [--size anumber]', usage: '[link to audio] [--size anumber]',
examples: ['https://cdn.discordapp.com/attachments/532987690145021982/682654351772221480/jeff.wav (optional) --size 1920x1080'] examples: ['https://cdn.discordapp.com/attachments/532987690145021982/682654351772221480/jeff.wav (optional) --size 1920x1080']
} }
@ -67,7 +67,7 @@ class audio2imageCommand extends Command {
.output(`${os.tmpdir()}/a2i${message.id}.png`) .output(`${os.tmpdir()}/a2i${message.id}.png`)
.on('error', (err, stdout, stderr) => { .on('error', (err, stdout, stderr) => {
console.error(`${err}\n${stdout}\n${stderr}`); console.error(`${err}\n${stdout}\n${stderr}`);
return message.channel.send('Uh oh, an error has occured! The image size is most likely bigger than the content!'); return message.channel.send('Uh oh, an error has occured! The image size is most likely bigger than the content! Try again!');
}) })
.on('end', () => { .on('end', () => {
console.log('finished'); console.log('finished');
@ -76,7 +76,7 @@ class audio2imageCommand extends Command {
let fileSize = (file.size / 1000000.0).toFixed(2); let fileSize = (file.size / 1000000.0).toFixed(2);
return message.channel.send(`Image is ${fileSize} MB for ${args.video_size} resolution`, {files: [`${os.tmpdir()}/a2i${message.id}.png`]}) return message.channel.send(`Image is ${fileSize} MB for ${args.video_size} resolution`, {files: [`${os.tmpdir()}/a2i${message.id}.png`]})
.catch(() => { .catch(() => {
return message.channel.send(`End result is too big to fit on discord! File is ${fileSize} MB`); }); return message.channel.send(`End result is too big to fit on discord! File is ${fileSize} MB! Unless it's GB or even TB, in which case that is a huge image!`); });
}) })
.run(); .run();
}) })

View file

@ -27,7 +27,7 @@ class CleverBotCommand extends Command {
} }
async exec(message, args) { async exec(message, args) {
let loadingmsg = await message.channel.send('Processing <a:loadingmin:527579785212329984>'); let loadingmsg = await message.channel.send('Processing! <a:loadingmin:527579785212329984>');
if (!conversation[message.guild.id]) conversation[message.guild.id] = []; if (!conversation[message.guild.id]) conversation[message.guild.id] = [];

View file

@ -9,7 +9,7 @@ class dosentexistCommand extends Command {
category: 'fun', category: 'fun',
clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'], clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'],
description: { description: {
content: 'Send images from thispersondoesnotexist.com', content: 'Send images from thispersondoesnotexist.com!,
usage: '', usage: '',
examples: [''] examples: ['']
} }

View file

@ -21,7 +21,7 @@ class vidshittifierCommand extends Command {
} }
], ],
description: { description: {
content: 'Make your vid shit quality.', content: 'Compress your videos and lower their quality!',
usage: '[link to video] [compression ( 1, 2 or 3)]', usage: '[link to video] [compression ( 1, 2 or 3)]',
examples: [''] examples: ['']
} }
@ -60,13 +60,13 @@ class vidshittifierCommand extends Command {
if (err) { if (err) {
console.error(err); console.error(err);
loadingmsg.delete(); loadingmsg.delete();
return message.channel.send('An error has occured, I can\'t download from the link you provided.'); return message.channel.send('An error has occured, I can\'t download from the link you provided. Try again!');
} else { } else {
shittifie(); shittifie();
} }
}); });
} else { } else {
return message.channel.send('You need a valid video link!'); return message.channel.send('You need a valid video link! Try again!');
} }
function shittifie() { function shittifie() {
@ -82,13 +82,13 @@ class vidshittifierCommand extends Command {
.catch(err => { .catch(err => {
console.error(err); console.error(err);
loadingmsg.delete(); loadingmsg.delete();
return message.channel.send('On no! an error just occured! perhaps the file is too big?'); return message.channel.send('On no! an error just occured! Maybe the file is too big?');
}); });
}) })
.catch(err => { .catch(err => {
console.error(err); console.error(err);
loadingmsg.delete(); loadingmsg.delete();
return message.channel.send('On no! an error just occured! Im gonna be honest with you, i don\'t know what caused it yet! but worry not! my owner will look into it soon!'); return message.channel.send('Oh no! an error just occured! We don't know what causes this error yet, so let us know!);
}); });
}); });
} }

View file

@ -208,7 +208,7 @@ class ytpCommand extends Command {
} }
} }
let loadingmsg = await message.channel.send(`Processing, this can take a **long** time, i'll ping you when i finished <a:loadingmin:527579785212329984>\nSome info: There is currently ${mp4.length} videos, you can add yours by doing \`\`${this.client.commandHandler.prefix[0]}ytp --add (link or attachment)\`\``); let loadingmsg = await message.channel.send(`Processing, this can take a ***long*** time, i'll ping you when i finished <a:loadingmin:527579785212329984>\nSome info: There are currently ${mp4.length} videos, you can add yours by doing \`\`${this.client.commandHandler.prefix[0]}ytp --add (link or attachment). Thanks for contributing!\`\``);
let options = { let options = {
@ -250,7 +250,7 @@ class ytpCommand extends Command {
await ytpHash.create(body); await ytpHash.create(body);
}); });
loadingmsg.delete(); loadingmsg.delete();
return message.reply('Here is your YTP! Remember, it might contain nsfw!', {files: [`${os.tmpdir()}/${message.id}_YTP.mp4`]}) return message.reply('Here is your YTP! Remember, it might contain nsfw, so be careful!', {files: [`${os.tmpdir()}/${message.id}_YTP.mp4`]})
.catch(err => { .catch(err => {
console.error(err); console.error(err);
return message.channel.send('Whoops, look like the vid might be too big for discord, my bad, please try again'); return message.channel.send('Whoops, look like the vid might be too big for discord, my bad, please try again');
@ -260,9 +260,9 @@ class ytpCommand extends Command {
console.error(err); console.error(err);
loadingmsg.delete(); loadingmsg.delete();
return message.reply({files: [Math.random() < 0.5 ? './asset/ytp/error1.mp4' : './asset/ytp/error2.mp4']}) return message.reply({files: [Math.random() < 0.5 ? './asset/ytp/error1.mp4' : './asset/ytp/error2.mp4']})
.catch(err => { // In case it can't send the vid for some reason .catch(err => { // In case it can't send the video for some reason
console.error(err); console.error(err);
return message.channel.send('Oh no, an error has occured! please try again.'); return message.channel.send('Oh no, an error has occured! please try again. If this happens alot, you should report this to the developers.');
}); });
}); });
} }