Bunch of update

mostly replacing message.channel.send with message.reply
( i hope it work this time... )
This commit is contained in:
supositware 2021-07-23 04:19:47 +02:00
parent 706867ae53
commit dfd25c8bf2
31 changed files with 114 additions and 122 deletions

View file

@ -33,7 +33,7 @@ class fakejoinCommand extends Command {
else else
member = message.guild.members.resolve(message.author.id); member = message.guild.members.resolve(message.author.id);
} else { } else {
return message.channel.send('There is no join channel setup'); return message.reply('There is no join channel setup');
} }
this.client.emit('guildMemberAdd', member); this.client.emit('guildMemberAdd', member);

View file

@ -33,7 +33,7 @@ class fakeleaveCommand extends Command {
else else
member = message.guild.members.resolve(message.author.id); member = message.guild.members.resolve(message.author.id);
} else { } else {
return message.channel.send('There is no leave channel setup'); return message.reply('There is no leave channel setup');
} }
this.client.emit('guildMemberRemove', member); this.client.emit('guildMemberRemove', member);

View file

@ -27,14 +27,14 @@ 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.reply('Processing! <a:loadingmin:527579785212329984>');
if (!conversation[message.guild.id]) conversation[message.guild.id] = []; if (!conversation[message.guild.id]) conversation[message.guild.id] = [];
if (!conversation[0]) { if (!conversation[0]) {
cleverbot(args.message).then(response => { cleverbot(args.message).then(response => {
conversation[message.guild.id].push(args.message); conversation[message.guild.id].push(args.message);
conversation[message.guild.id].push(response); conversation[message.guild.id].push(response);
return message.channel.send(response) return message.reply(response)
.then(() => { .then(() => {
loadingmsg.delete(); loadingmsg.delete();
}); });
@ -43,7 +43,7 @@ class CleverBotCommand extends Command {
cleverbot(args.message, conversation[message.guild.id]).then(response => { cleverbot(args.message, conversation[message.guild.id]).then(response => {
conversation[message.guild.id].push(args.message); conversation[message.guild.id].push(args.message);
conversation[message.guild.id].push(response); conversation[message.guild.id].push(response);
return message.channel.send(response) return message.reply(response)
.then(() => { .then(() => {
loadingmsg.delete(); loadingmsg.delete();
}); });

View file

@ -22,7 +22,7 @@ class dosentexistCommand extends Command {
const dest = fs.createWriteStream('./asset/img/de.png'); const dest = fs.createWriteStream('./asset/img/de.png');
res.body.pipe(dest); res.body.pipe(dest);
dest.on('finish', () => { dest.on('finish', () => {
return message.channel.send({files: ['./asset/img/de.png']}); return message.reply({files: ['./asset/img/de.png']});
}); });
}); } }); }
} }

View file

@ -17,7 +17,7 @@ class explosmCommand extends Command {
async exec(message) { async exec(message) {
extract({ uri: 'http://explosm.net/rcg' }, (err, res) => { extract({ uri: 'http://explosm.net/rcg' }, (err, res) => {
return message.channel.send({files: [res.ogImage]}); return message.reply({files: [res.ogImage]});
}); });
} }

View file

@ -69,11 +69,6 @@ class fakebotCommand extends Command {
else else
webhook.send(args.message); webhook.send(args.message);
setTimeout(() => {
webhook.delete({
reason: `Fakebot/user command triggered by: ${message.author.username}`
});
}, 3000);
}); });
}); });
} }

View file

@ -38,14 +38,14 @@ class RedditCommand extends Command {
}).then((response) => { }).then((response) => {
console.log(response); console.log(response);
if (response.error == 404) if (response.error == 404)
return message.channel.send('Not a valid subreddit'); return message.reply('Not a valid subreddit');
if (response.data.dist == 0) if (response.data.dist == 0)
return message.channel.send('Not a valid subreddit'); return message.reply('Not a valid subreddit');
let i = Math.floor((Math.random() * response.data.children.length)); let i = Math.floor((Math.random() * response.data.children.length));
if (response.data.children[i].data.over_18 == true && !message.channel.nsfw) if (response.data.children[i].data.over_18 == true && !message.channel.nsfw)
return message.channel.send('No nsfw'); return message.reply('No nsfw');
const redditEmbed = this.client.util.embed() const redditEmbed = this.client.util.embed()
.setColor(message.member ? message.member.displayHexColor : 'NAVY') .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle(response.data.children[i].data.title) .setTitle(response.data.children[i].data.title)
@ -53,8 +53,8 @@ class RedditCommand extends Command {
.setURL('https://reddit.com' + response.data.children[i].data.permalink) .setURL('https://reddit.com' + response.data.children[i].data.permalink)
.setFooter(`/r/${response.data.children[i].data.subreddit} | ⬆ ${response.data.children[i].data.ups} 🗨 ${response.data.children[i].data.num_comments}`); .setFooter(`/r/${response.data.children[i].data.subreddit} | ⬆ ${response.data.children[i].data.ups} 🗨 ${response.data.children[i].data.num_comments}`);
message.channel.send(redditEmbed); message.reply(redditEmbed);
message.channel.send(response.data.children[i].data.url); message.reply(response.data.children[i].data.url);
}); });
} }
} }

View file

@ -28,7 +28,7 @@ class spbCommand extends Command {
async exec(message, args) { async exec(message, args) {
if (!args.link || !args.link.href.includes('shitpostbot.com/template/')) { if (!args.link || !args.link.href.includes('shitpostbot.com/template/')) {
return message.channel.send('Need a Shitpostbot 5000 template link!\nYou can find them here! <https://www.shitpostbot.com/gallery/templates>'); return message.reply('Need a Shitpostbot 5000 template link!\nYou can find them here! <https://www.shitpostbot.com/gallery/templates>');
} }
let link = args.link.href.replace('template', 'preview'); let link = args.link.href.replace('template', 'preview');
@ -38,7 +38,7 @@ class spbCommand extends Command {
const dest = fs.createWriteStream(`${os.tmpdir()}/${message.id}.jpg`); const dest = fs.createWriteStream(`${os.tmpdir()}/${message.id}.jpg`);
res.body.pipe(dest); res.body.pipe(dest);
dest.on('finish', () => { dest.on('finish', () => {
return message.channel.send({files: [`${os.tmpdir()}/${message.id}.jpg`]}); return message.reply({files: [`${os.tmpdir()}/${message.id}.jpg`]});
}); });
}); });
} }

View file

@ -143,7 +143,7 @@ class ytpCommand extends Command {
} }
}); });
return message.channel.send(`There is currently ${mp4.length} videos, you can add yours by doing \`\`${this.client.commandHandler.prefix[0]}ytp --add (link or attachment)\`\``); return message.reply(`There is currently ${mp4.length} videos, you can add yours by doing \`\`${this.client.commandHandler.prefix[0]}ytp --add (link or attachment)\`\``);
} }
if (args.listproxy) { if (args.listproxy) {
@ -161,7 +161,7 @@ class ytpCommand extends Command {
.setDescription(proxys.join('\n')) .setDescription(proxys.join('\n'))
.setFooter('You can help me get more proxy by either donating to me or providing a proxy for me'); .setFooter('You can help me get more proxy by either donating to me or providing a proxy for me');
return message.channel.send(Embed); return message.reply(Embed);
} }
if (args.add) { if (args.add) {
@ -169,7 +169,7 @@ class ytpCommand extends Command {
const blacklist = await ytpblacklist.findOne({where: {userID:message.author.id}}); const blacklist = await ytpblacklist.findOne({where: {userID:message.author.id}});
if (blacklist) { if (blacklist) {
return message.channel.send(`You have been blacklisted for the following reasons: \`${blacklist.get('reason')}\` be less naughty next time.`); return message.reply(`You have been blacklisted for the following reasons: \`${blacklist.get('reason')}\` be less naughty next time.`);
} }
*/ */
@ -178,7 +178,7 @@ class ytpCommand extends Command {
if (!proxy[args.proxy]) args.proxy = 0; if (!proxy[args.proxy]) args.proxy = 0;
} }
let loadingmsg = await message.channel.send('Downloading <a:loadingmin:527579785212329984>'); let loadingmsg = await message.reply('Downloading <a:loadingmin:527579785212329984>');
let url; let url;
if (args.link) if (args.link)
@ -204,15 +204,15 @@ class ytpCommand extends Command {
args.proxyAuto = true; args.proxyAuto = true;
} }
if (!proxy[args.proxy]) return message.channel.send('`HTTP Error 429: Too Many Requests.`\nThe website you tried to download from probably has the bot blocked along with its proxy'); if (!proxy[args.proxy]) return message.reply('`HTTP Error 429: Too Many Requests.`\nThe website you tried to download from probably has the bot blocked along with its proxy');
loadingmsg.delete(); loadingmsg.delete();
return this.client.commandHandler.runCommand(message, this.client.commandHandler.findCommand('ytp'), args); return this.client.commandHandler.runCommand(message, this.client.commandHandler.findCommand('ytp'), args);
} }
if (err.includes('Error: status code 403')) return message.channel.send('`HTTP Error 403: Forbidden.`\nThe video you tried to download is not publicly available therefor the bot can\'t download it.'); if (err.includes('Error: status code 403')) return message.reply('`HTTP Error 403: Forbidden.`\nThe video you tried to download is not publicly available therefor the bot can\'t download it.');
return message.channel.send(err, { code: true }); return message.reply(err, { code: true });
}) })
.on('end', async output => { .on('end', async output => {
@ -280,12 +280,12 @@ class ytpCommand extends Command {
}); });
} else { } else {
loadingmsg.delete(); loadingmsg.delete();
return message.channel.send('You need a valid video link!'); return message.reply('You need a valid video link!');
} }
} }
if (!message.channel.nsfw && !args.force) return message.channel.send(`Please execute this command in an NSFW channel ( Content might not be NSFW but since the video are user submitted better safe than sorry ) OR do \`\`${this.client.commandHandler.prefix[0]}ytp --force\`\` to make the command work outside of nsfw channel BE AWARE THAT IT WON'T CHANGE THE FINAL RESULT SO NSFW CAN STILL HAPPEN`); if (!message.channel.nsfw && !args.force) return message.reply(`Please execute this command in an NSFW channel ( Content might not be NSFW but since the video are user submitted better safe than sorry ) OR do \`\`${this.client.commandHandler.prefix[0]}ytp --force\`\` to make the command work outside of nsfw channel BE AWARE THAT IT WON'T CHANGE THE FINAL RESULT SO NSFW CAN STILL HAPPEN`);
// Read userVid folder and select random vid and only take .mp4 // Read userVid folder and select random vid and only take .mp4
let mp4 = []; let mp4 = [];
@ -308,7 +308,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 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 loadingmsg = await message.reply(`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)\`\`\nLike ytp? Why not check out https://ytp.namejeff.xyz/`);
let options = { let options = {
@ -353,7 +353,7 @@ class ytpCommand extends Command {
return message.reply('Here is your YTP! Remember, it might contain nsfw, so be careful!', {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.reply('Whoops, look like the vid might be too big for discord, my bad, please try again');
}); });
}) })
.catch(err => { .catch(err => {
@ -368,7 +368,7 @@ class ytpCommand extends Command {
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 video 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 occurred! please try again. If this happens alot, you should report this to the developers.'); return message.reply('Oh no, an error has occurred! please try again. If this happens alot, you should report this to the developers.');
}); });
} }

View file

@ -21,11 +21,11 @@ class AdviceCommand extends Command {
}).then((response) => { }).then((response) => {
const adviceEmbed = this.client.util.embed() const adviceEmbed = this.client.util.embed()
.setColor(message.member ? message.member.displayHexColor : 'NAVY') .setColor(message.member ? message.member.displayHexColor : 'NAVY')
.setTitle(response.slip.slip_id) .setTitle(response.slip.id)
.setDescription(response.slip.advice); .setDescription(response.slip.advice);
message.channel.send(adviceEmbed); message.reply(adviceEmbed);
}); });
} }

View file

@ -30,8 +30,7 @@ class ClapCommand extends Command {
args.text = rand.random(args.text, message); args.text = rand.random(args.text, message);
let clap = args.text.replace(/ /g, ' 👏 '); let clap = args.text.replace(/ /g, ' 👏 ');
message.delete(); message.reply(`${clap} 👏`);
message.channel.send(`${clap} 👏`);
} }
} }

View file

@ -27,7 +27,7 @@ class randomizerCommand extends Command {
async exec(message, args) { async exec(message, args) {
let words = args.text.split(' '); let words = args.text.split(' ');
return message.channel.send(words[Math.floor((Math.random() * words.length))]); return message.reply(words[Math.floor((Math.random() * words.length))]);
} }
} }

View file

@ -34,7 +34,7 @@ class tweetCommand extends Command {
async exec(message, args) { async exec(message, args) {
let Attachment = (message.attachments).array(); let Attachment = (message.attachments).array();
if (!Attachment[0] && !args.text) return message.channel.send('You need to input something for me to tweet!'); if (!Attachment[0] && !args.text) return message.reply('You need to input something for me to tweet!');
let date = new Date(); let date = new Date();
// see if user is not banned // see if user is not banned
@ -42,24 +42,33 @@ class tweetCommand extends Command {
const blacklist = await TwitterBlacklist.findOne({where: {userID:message.author.id}}); const blacklist = await TwitterBlacklist.findOne({where: {userID:message.author.id}});
if (blacklist) { if (blacklist) {
return message.channel.send(`You have been blacklisted for the following reasons: \`${blacklist.get('reason')}\` be less naughty next time.`); return message.reply(`You have been blacklisted for the following reasons: \`${blacklist.get('reason')}\` be less naughty next time.`);
} }
*/ */
// If account is less than 6 months old don't accept the tweet ( alt prevention ) // If account is less than 6 months old don't accept the tweet ( alt prevention )
if (message.author.createdAt > date.setMonth(date.getMonth() - 6)) { if (message.author.createdAt > date.setMonth(date.getMonth() - 6)) {
return message.channel.send('Your account is too new to be able to use this command!'); return message.reply('Your account is too new to be able to use this command!');
} }
// If account is less than 1 year old don't accept attachment // If account is less than 1 year old don't accept attachment
if (Attachment[0] && message.author.createdAt > date.setFullYear(date.getFullYear() - 1 )) { if (Attachment[0] && message.author.createdAt > date.setFullYear(date.getFullYear() - 1 )) {
return message.channel.send('Your account need to be 1 year or older to be able to send attachment!'); return message.reply('Your account need to be 1 year or older to be able to send attachment!');
} }
// remove zero width space and use the dictionary thingy
let text = '';
if (args.text) { if (args.text) {
text = args.text.replace('', '');
text = rand.random(text, message);
}
if (text) {
// Detect banned word (Blacklist the user directly) // Detect banned word (Blacklist the user directly)
if (wordToCensor.includes(args.text)) { if (wordToCensor.includes(text) || wordToCensor.includes(text.substr(0, text.length - 1)) || wordToCensor.includes(text.substr(1, text.length))) {
const body = {type:'tweet', uid: message.author.id, reason: 'Automatic ban from banned word.'}; const body = {type:'tweet', uid: message.author.id, reason: 'Automatic ban from banned word.'};
Blacklists.create(body); Blacklists.create(body);
/* /*
const body = {userID: message.author.id, reason: }; const body = {userID: message.author.id, reason: };
TwitterBlacklist.create(body); TwitterBlacklist.create(body);
@ -72,7 +81,7 @@ class tweetCommand extends Command {
// Do not allow discord invites // Do not allow discord invites
if (args.text.includes('discord.gg') || args.text.includes('discord.com/invite/')) return message.channel.send('No discord invite allowed.'); if (args.text.includes('discord.gg') || args.text.includes('discord.com/invite/')) return message.channel.send('No discord invite allowed.');
} }
const client = this.client; const client = this.client;
let T = new Twit({ let T = new Twit({
@ -82,27 +91,6 @@ class tweetCommand extends Command {
access_token_secret: twiTokenSecret access_token_secret: twiTokenSecret
}); });
/*
// Censor words
let censor = reload('../../json/censor.json');
let uncensor = reload('../../json/uncensor.json');
filter.addWords(...censor);
filter.removeWords(...uncensor);
*/
// remove zero width space
let text = '';
if (args.text) {
text = args.text.replace('', '');
/*
//Filter out swear word
text = filter.clean(text);
*/
text = rand.random(text, message);
}
try { try {
// Make sure there is an attachment and if its an image // Make sure there is an attachment and if its an image
if (Attachment[0]) { if (Attachment[0]) {
@ -116,9 +104,9 @@ class tweetCommand extends Command {
let fileSize = file.size / 1000000.0; let fileSize = file.size / 1000000.0;
if ((Attachment[0].name.endsWith('.jpg') || Attachment[0].name.endsWith('.png')) && fileSize > 5) { if ((Attachment[0].name.endsWith('.jpg') || Attachment[0].name.endsWith('.png')) && fileSize > 5) {
return message.channel.send('Images can\'t be larger than 5 MB!'); return message.reply('Images can\'t be larger than 5 MB!');
} else if (Attachment[0].name.endsWith('.gif') && fileSize > 15) { } else if (Attachment[0].name.endsWith('.gif') && fileSize > 15) {
return message.channel.send('Gifs can\'t be larger than 15 MB!'); return message.reply('Gifs can\'t be larger than 15 MB!');
} }
let b64Image = fs.readFileSync(`${os.tmpdir()}/${Attachment[0].name}`, { encoding: 'base64'}); let b64Image = fs.readFileSync(`${os.tmpdir()}/${Attachment[0].name}`, { encoding: 'base64'});
@ -126,7 +114,7 @@ class tweetCommand extends Command {
if (err) { if (err) {
console.log('OH NO AN ERROR!!!!!!!'); console.log('OH NO AN ERROR!!!!!!!');
console.error(err); console.error(err);
return message.channel.send('OH NO!!! AN ERROR HAS occurred!!! please hold on while i find what\'s causing this issue! '); return message.reply('OH NO!!! AN ERROR HAS occurred!!! please hold on while i find what\'s causing this issue! ');
} else { } else {
Tweet(data); Tweet(data);
} }
@ -134,14 +122,14 @@ class tweetCommand extends Command {
}); });
}); });
} else { } else {
return message.channel.send('File type not supported, you can only send jpg/png/gif'); return message.reply('File type not supported, you can only send jpg/png/gif');
} }
} else { } else {
Tweet(); Tweet();
} }
} catch(err) { } catch(err) {
console.error(err); console.error(err);
return message.channel.send('Oh no, an error has occurred :('); return message.reply('Oh no, an error has occurred :(');
} }
function Tweet(data) { function Tweet(data) {
@ -162,13 +150,13 @@ class tweetCommand extends Command {
T.post('statuses/update', options, function (err, response) { T.post('statuses/update', options, function (err, response) {
if (err) { if (err) {
if (err.code == 88) return message.channel.send(err.message); // Rate limit exceeded if (err.code == 88) return message.reply(err.message); // Rate limit exceeded
if (err.code == 186) return message.channel.send(`${err.message} Your message was ${text.length} characters, you need to remove ${text.length - 280} characters (This count may be inaccurate if your message contained link)`); // Tweet needs to be a bit shorter. if (err.code == 186) return message.reply(`${err.message} Your message was ${text.length} characters, you need to remove ${text.length - 280} characters (This count may be inaccurate if your message contained link)`); // Tweet needs to be a bit shorter.
if (err.code == 187) return message.channel.send(err.message); // Status is a duplicate. if (err.code == 187) return message.reply(err.message); // Status is a duplicate.
if (err.code == 326) return message.channel.send(err.message); // To protect our users from spam and other malicious activity, this account is temporarily locked. if (err.code == 326) return message.reply(err.message); // To protect our users from spam and other malicious activity, this account is temporarily locked.
console.error('OH NO!!!!'); console.error('OH NO!!!!');
console.error(err); console.error(err);
return message.channel.send('OH NO!!! AN ERROR HAS occurred!!! please hold on while i find what\'s causing this issue! '); return message.reply('OH NO!!! AN ERROR HAS occurred!!! please hold on while i find what\'s causing this issue! ');
} }
const tweetid = response.id_str; const tweetid = response.id_str;
@ -200,7 +188,7 @@ class tweetCommand extends Command {
channel = client.channels.resolve(twiChannel); channel = client.channels.resolve(twiChannel);
channel.send({embed: Embed}); channel.send({embed: Embed});
return message.channel.send(`Go see ur epic tweet ${TweetLink}`); return message.reply(`Go see ur epic tweet ${TweetLink}`);
}); });
} }

View file

@ -28,9 +28,9 @@ class OwnedCommand extends Command {
if (args.member) { if (args.member) {
if (args.member.id == this.client.user.id) { if (args.member.id == this.client.user.id) {
return message.channel.send('You really thought you could own me?, pathetic...'); return message.reply('You really thought you could own me?, pathetic...');
} else if (args.member.id == this.client.ownerID) { } else if (args.member.id == this.client.ownerID) {
return message.channel.send('You really thought you could own him?, pathetic...'); return message.reply('You really thought you could own him?, pathetic...');
} else if (args.member.id == '286054184623538177' || args.member.id == '172112210863194113') { } else if (args.member.id == '286054184623538177' || args.member.id == '172112210863194113') {
owned = message.author; owned = message.author;
} }
@ -41,9 +41,9 @@ class OwnedCommand extends Command {
return message.reply(ownedMessage); return message.reply(ownedMessage);
} }
return message.channel.send(`${owned}, ${ownedMessage}`); return message.send(`${owned}, ${ownedMessage}`);
} else { } else {
return message.channel.send(ownedMessage); return message.send(ownedMessage);
} }
} }
} }

View file

@ -15,7 +15,7 @@ class premiumCommand extends Command {
} }
async exec(message) { async exec(message) {
return message.channel.send('EPIC TF2 FEATURE HERE !!!!!!111111 YOU CAN FLY AND CHEAT !!!!!!!!!!!!!!!!! ALSO PREMIUM SONG AND ANNOY EVERYONE AND FLEX ON EM HATERS WITH CUSTOM SKIN!!!!'); return message.reply('EPIC TF2 FEATURE HERE !!!!!!111111 YOU CAN FLY AND CHEAT !!!!!!!!!!!!!!!!! ALSO PREMIUM SONG AND ANNOY EVERYONE AND FLEX ON EM HATERS WITH CUSTOM SKIN!!!!');
} }
} }

View file

@ -14,7 +14,7 @@ class sexCommand extends Command {
} }
async exec(message) { async exec(message) {
return message.channel.send('69\nHaha lol Le sex numbers xDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD'); return message.reply('69\nHaha lol Le sex numbers xDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD');
} }
} }

View file

@ -22,12 +22,12 @@ class unownedCommand extends Command {
async exec(message, args) { async exec(message, args) {
if (args.member) { if (args.member) {
return message.channel.send('You can\'t do that! that\'s illegal!'); return message.reply('You can\'t do that! that\'s illegal!');
} }
if (message.author.id == '267065637183029248') { if (message.author.id == '267065637183029248') {
return message.channel.send('You have been sucessfully unowned'); return message.reply('You have been sucessfully unowned');
} }
return message.channel.send('You can\'t unown what has already been owned <:classictroll:488559136494321703>'); return message.reply('You can\'t unown what has already been owned <:classictroll:488559136494321703>');
} }
} }

View file

@ -1,4 +1,5 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
const attachment = require('../../utils/attachment');
const gm = require('gm').subClass({imageMagick: true}); const gm = require('gm').subClass({imageMagick: true});
const os = require('os'); const os = require('os');
const fetch = require('node-fetch'); const fetch = require('node-fetch');
@ -60,22 +61,30 @@ class posterCommand extends Command {
async exec(message, args) { async exec(message, args) {
let options = args.message.trim().split('|'); let options = args.message.trim().split('|');
let url;
console.log(args.link);
if (args.link !== '^')
url = new URL(args.link);
else
url = await attachment(message);
console.log(url);
if (options[0] == undefined) if (options[0] == undefined)
options[0] = ''; options[0] = '';
else if (options[1] == undefined) else if (options[1] == undefined)
options[1] = ''; options[1] = '';
let url = args.link;
if (!url) { if (!url) {
return message.channel.send('You need an image to use this command!'); return message.reply('You need an image to use this command!');
} }
let loadingmsg = await message.channel.send('Processing <a:loadingmin:527579785212329984>'); let loadingmsg = await message.reply('Processing <a:loadingmin:527579785212329984>');
// Create new graphicsmagick instance // Create new graphicsmagick instance
fetch(url) fetch(url.href)
.then(res => { .then(res => {
const dest = fs.createWriteStream(`${os.tmpdir()}/${message.id}`); const dest = fs.createWriteStream(`${os.tmpdir()}/${message.id}`);
res.body.pipe(dest); res.body.pipe(dest);
@ -93,7 +102,7 @@ class posterCommand extends Command {
img.format(function(err, format) { img.format(function(err, format) {
if (err) { if (err) {
console.error(err); console.error(err);
return message.channel.send('An error has occurred, is it an image?'); return message.reply('An error has occurred, is it an image?');
} }
let output1 = `${os.tmpdir()}/poster${message.author.id}.${format.toLowerCase()}`; let output1 = `${os.tmpdir()}/poster${message.author.id}.${format.toLowerCase()}`;
let output2 = `${os.tmpdir()}/poster${message.id}.${format.toLowerCase()}`; let output2 = `${os.tmpdir()}/poster${message.id}.${format.toLowerCase()}`;
@ -127,7 +136,7 @@ class posterCommand extends Command {
.write(output1, function(err) { .write(output1, function(err) {
if (err) { if (err) {
console.error(err); console.error(err);
return message.channel.send('An error just occurred! is it a static image?'); return message.reply('An error just occurred! is it a static image?');
} }
// Chop the top part of the image // Chop the top part of the image
let img2 = gm(output1); let img2 = gm(output1);
@ -136,7 +145,7 @@ class posterCommand extends Command {
loadingmsg.delete(); loadingmsg.delete();
if (err) { if (err) {
console.error(err); console.error(err);
return message.channel.send('An error just occurred! is it a static image?'); return message.reply('An error just occurred! is it a static image?');
} }
message.delete(); message.delete();
return message.channel.send(`Made by ${message.author.username}`,{files: [output2]}) return message.channel.send(`Made by ${message.author.username}`,{files: [output2]})
@ -152,7 +161,7 @@ class posterCommand extends Command {
}) })
.catch((err) => { .catch((err) => {
console.error(err); console.error(err);
return message.channel.send(`Please input a correct link \`${err}\``); return message.reply(`Please input a correct link \`${err}\``);
}); });
} }
} }

View file

@ -28,34 +28,34 @@ class rpsCommand extends Command {
switch (playerHand) { switch (playerHand) {
case 'rock': case 'rock':
if (pcHand==1) { if (pcHand==1) {
message.channel.send('You both chose rock!'); message.reply('You both chose rock!');
} else if (pcHand==2) { } else if (pcHand==2) {
message.channel.send('The bot chose paper, you lose!'); message.reply('The bot chose paper, you lose!');
} else { } else {
message.channel.send('The bot chose scissors, you win!'); message.reply('The bot chose scissors, you win!');
} }
break; break;
case 'paper': case 'paper':
if (pcHand==1) { if (pcHand==1) {
message.channel.send('You both chose paper!'); message.reply('You both chose paper!');
} else if (pcHand==2) { } else if (pcHand==2) {
message.channel.send('The bot chose scissors, you lose!'); message.reply('The bot chose scissors, you lose!');
} else { } else {
message.channel.send('The bot chose rock, you win!'); message.reply('The bot chose rock, you win!');
} }
break; break;
case 'scissors': case 'scissors':
if (pcHand==1) { if (pcHand==1) {
message.channel.send('You both chose scissors!'); message.reply('You both chose scissors!');
} else if (pcHand==2) { } else if (pcHand==2) {
message.channel.send('The bot chose rock, you lose!'); message.reply('The bot chose rock, you lose!');
} else { } else {
message.channel.send('The bot chose paper, you win!'); message.reply('The bot chose paper, you win!');
} }
break; break;
default: default:
message.channel.send(`You entered ${playerHand} which is an incorrect choice.`); message.reply(`You entered ${playerHand} which is an incorrect choice. Try again with rock, paper or scissors`);
break; break;
} }

View file

@ -52,7 +52,7 @@ class aboutCommand extends Command {
.setThumbnail('https://its.gamingti.me/ZiRe.png') .setThumbnail('https://its.gamingti.me/ZiRe.png')
.setFooter(`Original bot made by ${this.client.users.resolve('267065637183029248').tag} (267065637183029248)`); // Please this line .setFooter(`Original bot made by ${this.client.users.resolve('267065637183029248').tag} (267065637183029248)`); // Please this line
message.channel.send(aboutEmbed); message.reply(aboutEmbed);
}); });
} }
} }

View file

@ -38,7 +38,7 @@ class AvatarCommand extends Command {
avatarEmbed.setDescription(`[png](${message.author.displayAvatarURL({ format: 'png', size: 2048 })}) | [jpeg](${message.author.displayAvatarURL({ format: 'jpg', size: 2048 })}) | [webp](${message.author.displayAvatarURL({ format: 'webp', size: 2048 })})`); avatarEmbed.setDescription(`[png](${message.author.displayAvatarURL({ format: 'png', size: 2048 })}) | [jpeg](${message.author.displayAvatarURL({ format: 'jpg', size: 2048 })}) | [webp](${message.author.displayAvatarURL({ format: 'webp', size: 2048 })})`);
avatarEmbed.setImage(message.author.displayAvatarURL({ format: 'png', size: 2048 })); avatarEmbed.setImage(message.author.displayAvatarURL({ format: 'png', size: 2048 }));
} }
return message.channel.send({embed: avatarEmbed}); return message.reply({embed: avatarEmbed});
} else { } else {
let format = args.user.displayAvatarURL({ dynamic: true }).substr(args.user.displayAvatarURL({ dynamic: true }).length - 3); let format = args.user.displayAvatarURL({ dynamic: true }).substr(args.user.displayAvatarURL({ dynamic: true }).length - 3);
console.log(format); console.log(format);
@ -51,7 +51,7 @@ class AvatarCommand extends Command {
avatarEmbed.setDescription(`[png](${args.user.displayAvatarURL({ format: 'png', size: 2048 })}) | [jpeg](${args.user.displayAvatarURL({ format: 'jpg', size: 2048 })}) | [webp](${args.user.displayAvatarURL({ format: 'webp', size: 2048 })})`); avatarEmbed.setDescription(`[png](${args.user.displayAvatarURL({ format: 'png', size: 2048 })}) | [jpeg](${args.user.displayAvatarURL({ format: 'jpg', size: 2048 })}) | [webp](${args.user.displayAvatarURL({ format: 'webp', size: 2048 })})`);
avatarEmbed.setImage(args.user.displayAvatarURL({ format: 'png', size: 2048 })); avatarEmbed.setImage(args.user.displayAvatarURL({ format: 'png', size: 2048 }));
} }
return message.channel.send({embed: avatarEmbed}); return message.reply({embed: avatarEmbed});
} }
} }
} }

View file

@ -16,7 +16,7 @@ class donateCommand extends Command {
} }
async exec(message) { async exec(message) {
if (donations === undefined) return message.channel.send('No donations has been setup on that bot.'); if (donations === undefined) return message.reply('No donations has been setup on that bot.');
let desc = 'If you decide to donate, please use the feedback command to let the owner know about it so he can put you in the about and donator command.'; let desc = 'If you decide to donate, please use the feedback command to let the owner know about it so he can put you in the about and donator command.';
@ -29,7 +29,7 @@ class donateCommand extends Command {
.setTitle('Donation link') .setTitle('Donation link')
.setDescription(desc); .setDescription(desc);
return message.channel.send(Embed); return message.reply(Embed);
} }
} }

View file

@ -32,7 +32,7 @@ class donatorCommand extends Command {
donatorMessage += 'No one :('; donatorMessage += 'No one :(';
} }
return message.channel.send(donatorMessage); return message.reply(donatorMessage);
} }
} }

View file

@ -47,7 +47,7 @@ class FeedbackCommand extends Command {
// Don't let new account use this command to prevent spam, if they have an UUID its fine to skip it // Don't let new account use this command to prevent spam, if they have an UUID its fine to skip it
let date = new Date(); let date = new Date();
if (message.author.createdAt > date.setDate(date.getDate() - 7)) { if (message.author.createdAt > date.setDate(date.getDate() - 7)) {
return message.channel.send('Your account is too new to be able to use this command!'); return message.reply('Your account is too new to be able to use this command!');
} }
const channel = this.client.channels.resolve(feedbackChannel); const channel = this.client.channels.resolve(feedbackChannel);
@ -58,7 +58,7 @@ class FeedbackCommand extends Command {
channel.send({embed: Embed}); channel.send({embed: Embed});
message.channel.send('Your feedback has been sent! Don\'t forget to have dm open if you want to get an answer from the dev!'); message.reply('Your feedback has been sent! Don\'t forget to have dm open if you want to get an answer from the dev!');
} }
} }

View file

@ -36,7 +36,7 @@ class ServerCommand extends Command {
if (logStats) addEmbed.addField('Logging', 'On ✅'); if (logStats) addEmbed.addField('Logging', 'On ✅');
else addEmbed.addField('Logging', 'Off ❌'); else addEmbed.addField('Logging', 'Off ❌');
message.channel.send({ embed: addEmbed }); message.reply({ embed: addEmbed });
} }
} }

View file

@ -38,7 +38,7 @@ class serverIconCommand extends Command {
serverEmbed.setDescription(`[png](${message.guild.iconURL({ format: 'png', size: 2048 })}) | [jpeg](${message.guild.iconURL({ format: 'jpg', size: 2048 })}) | [webp](${message.guild.iconURL({ format: 'webp', size: 2048 })})`); serverEmbed.setDescription(`[png](${message.guild.iconURL({ format: 'png', size: 2048 })}) | [jpeg](${message.guild.iconURL({ format: 'jpg', size: 2048 })}) | [webp](${message.guild.iconURL({ format: 'webp', size: 2048 })})`);
serverEmbed.setImage(message.guild.iconURL({ format: 'png', size: 2048 })); serverEmbed.setImage(message.guild.iconURL({ format: 'png', size: 2048 }));
} }
return message.channel.send({embed: serverEmbed}); return message.reply({embed: serverEmbed});
} else { } else {
let format = this.client.guilds.find(guild => guild.id == args.serverid).iconURL().substr(this.client.guilds.find(guild => guild.id == args.serverid).iconURL().length - 3); let format = this.client.guilds.find(guild => guild.id == args.serverid).iconURL().substr(this.client.guilds.find(guild => guild.id == args.serverid).iconURL().length - 3);
if (format == 'gif') { if (format == 'gif') {
@ -50,7 +50,7 @@ class serverIconCommand extends Command {
serverEmbed.setDescription(`[png](${this.client.guilds.find(guild => guild.id == args.serverid).iconURL({ format: 'png', size: 2048 })}) | [jpeg](${this.client.guilds.find(guild => guild.id == args.serverid).iconURL({ format: 'jpg', size: 2048 })}) | [webp](${this.client.guilds.find(guild => guild.id == args.serverid).iconURL({ format: 'webp', size: 2048 })})`); serverEmbed.setDescription(`[png](${this.client.guilds.find(guild => guild.id == args.serverid).iconURL({ format: 'png', size: 2048 })}) | [jpeg](${this.client.guilds.find(guild => guild.id == args.serverid).iconURL({ format: 'jpg', size: 2048 })}) | [webp](${this.client.guilds.find(guild => guild.id == args.serverid).iconURL({ format: 'webp', size: 2048 })})`);
serverEmbed.setImage(this.client.guilds.find(guild => guild.id == args.serverid).iconURL({ format: 'png', size: 2048 })); serverEmbed.setImage(this.client.guilds.find(guild => guild.id == args.serverid).iconURL({ format: 'png', size: 2048 }));
} }
return message.channel.send({embed: serverEmbed}); return message.reply({embed: serverEmbed});
} }
} }
} }

View file

@ -58,7 +58,7 @@ class StatsCommand extends Command {
.addField('Discord-Akairo version', akairoVersion, true) .addField('Discord-Akairo version', akairoVersion, true)
.setTimestamp(); .setTimestamp();
return message.channel.send(statsEmbed); return message.reply(statsEmbed);
} }
} }

View file

@ -26,7 +26,7 @@ class UpdootCommand extends Command {
.setTimestamp() .setTimestamp()
.setFooter('Thanks for the updoots', this.client.user.avatarURL); .setFooter('Thanks for the updoots', this.client.user.avatarURL);
message.channel.send({ embed: upDoot }); message.reply({ embed: upDoot });
} }
} }

View file

@ -28,7 +28,7 @@ class userInfoCommand extends Command {
user = args.user; user = args.user;
} }
let member = message.guild.member(user); let member = await message.guild.members.fetch(user);
const Embed = this.client.util.embed() const Embed = this.client.util.embed()
.setColor(member ? member.displayHexColor : 'NAVY') .setColor(member ? member.displayHexColor : 'NAVY')
.setAuthor(`${user.tag} (${user.id})`, user.displayAvatarURL()) .setAuthor(`${user.tag} (${user.id})`, user.displayAvatarURL())
@ -69,7 +69,7 @@ class userInfoCommand extends Command {
if (member.roles) Embed.addField('Roles', `${member.roles.cache.array().join(', ')}`); if (member.roles) Embed.addField('Roles', `${member.roles.cache.array().join(', ')}`);
} }
return message.channel.send({ embed: Embed }); return message.reply({ embed: Embed });
} }
} }

View file

@ -25,7 +25,7 @@ class wallpaperCommand extends Command {
async exec(message, args) { async exec(message, args) {
let mkt = args.region; let mkt = args.region;
if (!args.region) mkt = 'en-US'; if (!args.region) mkt = 'en-US';
if (!['zh-CN', 'en-US', 'ja-JP', 'en-AU', 'en-UK', 'de-DE', 'en-NZ', 'en-CA'].includes(mkt)) return message.channel.send('Please choose a valid region settings: zh-CN, en-US, ja-JP, en-AU, en-UK, de-DE, en-NZ, en-CA'); if (!['zh-CN', 'en-US', 'ja-JP', 'en-AU', 'en-UK', 'de-DE', 'en-NZ', 'en-CA'].includes(mkt)) return message.reply('Please choose a valid region settings: zh-CN, en-US, ja-JP, en-AU, en-UK, de-DE, en-NZ, en-CA');
fetch(`https://bing.biturl.top/?mkt=${mkt}`) fetch(`https://bing.biturl.top/?mkt=${mkt}`)
.then(res => { .then(res => {
return res.json(); return res.json();
@ -38,7 +38,7 @@ class wallpaperCommand extends Command {
.setDescription(`[1366](https://bing.biturl.top/?resolution=1366&format=image&mkt=${mkt}) | [1920](https://bing.biturl.top/?resolution=1920&format=image&mkt=${mkt})`) .setDescription(`[1366](https://bing.biturl.top/?resolution=1366&format=image&mkt=${mkt}) | [1920](https://bing.biturl.top/?resolution=1920&format=image&mkt=${mkt})`)
.setImage(res.url); .setImage(res.url);
return message.channel.send(wallpaperEmbed); return message.reply(wallpaperEmbed);
}); });
} }
} }

View file

@ -21,6 +21,8 @@ class messageListener extends Listener {
} }
async exec(message) { async exec(message) {
if (message.author.bot) return;
const blacklist = await userBlacklist.findOne({where: {userID:message.author.id}}); const blacklist = await userBlacklist.findOne({where: {userID:message.author.id}});
if (blacklist) return; if (blacklist) return;
@ -34,7 +36,6 @@ class messageListener extends Listener {
await message.guild.members.fetch(); await message.guild.members.fetch();
if (message.author.bot) return;
/* Banned words section /* Banned words section
* *
@ -87,7 +88,7 @@ class messageListener extends Listener {
if (message.guild) { if (message.guild) {
const autoresponseStat = await autoResponseStat.findOne({where: {serverID: message.guild.id, stat: 'enable'}}); const autoresponseStat = await autoResponseStat.findOne({where: {serverID: message.guild.id, stat: 'enable'}});
if (autoresponseStat) { if (autoresponseStat) {
// Infinit haha very yes // Infinite haha very yes
if (message.content.toLowerCase().startsWith('haha very') && message.content.toLowerCase().endsWith('yes')) { if (message.content.toLowerCase().startsWith('haha very') && message.content.toLowerCase().endsWith('yes')) {
let yes = message.content.toLowerCase().replace('haha', ''); let yes = message.content.toLowerCase().replace('haha', '');
yes = yes.replace('yes', ''); yes = yes.replace('yes', '');