Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (command == 'art' || command == 'artwork' || command == 'fanart' || command == 'fanartwork') {
- if (args[0] == 'submit') {
- var attachmentimg = (msg.attachments.array().length < 1 === false) ? msg.attachments.array() : args[1];
- if ((attachmentimg !== args[1]) ? attachmentimg[0].filesize < 10000000 : true == true) {
- var __aurl = /https:\/\/cdn\.discordapp\.com\/attachments\/[\s\S]*?\//;
- var ____i = attachmentimg[0].url;
- var ___y = `${____i}`.replace(__aurl, "")
- var ___Y = `${___y}`.replace('/', '--');
- var _fImg = (attachmentimg !== args[1]) ? `./imgcache/${___Y}` : args[1];
- var fanartcomment = (_fImg == args[1]) ? args.slice(2, 540).join(' ') : args.slice(1, 540).join(' ');
- } else var fanartcomment = (attachmentimg == args[1]) ? args.slice(2, 540).join(' ') : args.slice(1, 540).join(' ');
- setTimeout(function () {
- bot.guilds.get('601902117468504088').channels.get('601902220191072277').send(`Cached image: \`${___Y}\``, {
- file: _fImg
- }).then(m => {
- ogmsg = msg.attachments.array()
- if (ogmsg[0].filesize < 10000000) {
- __img = m.attachments.array();
- } else __img = msg.attachments.array();
- var fileExtArrayImg = ['.jpg', '.jpeg', '.png', '.bmp', '.gif', '.webp', '.jif'];
- var fExtArrayMov = ['.mov', '.mp4', '.avi', '.webm', '.wmv'];
- for (i = 0; i < fileExtArrayImg.length; i++) {
- for (_i = 0; _i < fExtArrayMov.length; _i++) {
- if (`${__img[0].url}`.toLowerCase().includes(fileExtArrayImg[i])) { //image
- let emb_fanart_submit = new Discord.RichEmbed()
- .setAuthor('New fan-art submitted', (!msg.author.avatarURL) ? msg.author.defaultAvatarURL : msg.author.avatarURL, __img[0].url)
- .setImage(__img[0].url)
- .setDescription(`Submitted by <@${msg.author.id}>.`)
- .addField('Comment', (fanartcomment.length < 1 === false) ? fanartcomment : '`No comment.`', false)
- .setFooter('If you want to submit your own image, go to the fan-art F.A.Q channel.')
- bot.channels.get('564945014308995102').send(RichEmbed = emb_fanart_submit);
- break;
- }
- if (`${__img[0].url}`.toLowerCase().includes(fExtArrayMov[i])) {
- bot.channels.get('564945014308995102').send(`**New fan-art submitted**\nSubmitted by <@${msg.author.id}>.\n\n**Comment**\n${fanartcomment}\n\n**Video:** ${__img[0].url}`);
- break;
- } else return;
- }
- }
- }).catch(err => console.log(err))
- }, 2200)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement