From f96f9ba7e8939d5bbf20a8f8d7ff5f424a97ffde Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Fri, 25 Feb 2022 00:56:32 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/Economy/divorce.js | 1 + commands/Fun/ascii.js | 2 +- commands/Fun/lmg.js | 2 +- commands/General/permissions.js | 2 +- commands/General/report.js | 2 +- commands/General/suggest.js | 2 +- commands/Images/approved.js | 2 +- commands/Images/avatar.js | 4 +-- commands/Images/batslap.js | 2 +- commands/Images/beautiful.js | 2 +- commands/Images/bed.js | 2 +- commands/Images/brazzers.js | 2 +- commands/Images/burn.js | 2 +- commands/Images/captcha.js | 2 +- commands/Images/challenger.js | 2 +- commands/Images/clyde.js | 2 +- commands/Images/crush.js | 2 +- commands/Images/dictator.js | 2 +- commands/Images/facepalm.js | 2 +- commands/Images/fire.js | 2 +- commands/Images/jail.js | 2 +- commands/Images/love.js | 2 +- commands/Images/magik.js | 2 +- commands/Images/mission.js | 2 +- commands/Images/phcomment.js | 2 +- commands/Images/ps4.js | 2 +- commands/Images/rip.js | 2 +- commands/Images/scary.js | 2 +- commands/Images/steamcard.js | 2 +- commands/Images/tobecontinued.js | 2 +- commands/Images/trash.js | 2 +- commands/Images/triggered.js | 2 +- commands/Images/wanted.js | 2 +- commands/Images/wasted.js | 2 +- commands/Images/youtube-comment.js | 2 +- commands/Moderation/announcement.js | 2 +- commands/Moderation/ban.js | 14 +++++----- commands/Moderation/kick.js | 28 ++++++++++--------- commands/Moderation/mute.js | 16 ++++++----- commands/Moderation/poll.js | 2 +- commands/Moderation/warn.js | 42 ++++++++++++++++------------- commands/Owner/eval.js | 4 +-- 42 files changed, 97 insertions(+), 82 deletions(-) diff --git a/commands/Economy/divorce.js b/commands/Economy/divorce.js index 2f280fc5..84aabcf4 100644 --- a/commands/Economy/divorce.js +++ b/commands/Economy/divorce.js @@ -33,6 +33,7 @@ class Divorce extends Command { message.success("economy/divorce:DIVORCED", { username: user.username }); + user.send({ content: message.translate("economy/divorce:DIVORCED_U", { username: message.author.username diff --git a/commands/Fun/ascii.js b/commands/Fun/ascii.js index d0138916..ae70522b 100644 --- a/commands/Fun/ascii.js +++ b/commands/Fun/ascii.js @@ -25,7 +25,7 @@ class Ascii extends Command { const rendered = await figletAsync(text); - message.channel.send({ + message.reply({ content: "```" + rendered + "```" }); } diff --git a/commands/Fun/lmg.js b/commands/Fun/lmg.js index d5017352..ebef62e2 100644 --- a/commands/Fun/lmg.js +++ b/commands/Fun/lmg.js @@ -20,7 +20,7 @@ class Lmg extends Command { const question = args.join(" "); if (!question) return message.error("fun/lmg:MISSING"); const encodedQuestion = question.replace(/[' '_]/g, "+"); - await message.channel.send({ + await message.reply({ content: `https://google.gik-team.com/?q=${encodedQuestion}` }); message.delete().catch(() => {}); diff --git a/commands/General/permissions.js b/commands/General/permissions.js index d1f47689..c057dac7 100644 --- a/commands/General/permissions.js +++ b/commands/General/permissions.js @@ -41,7 +41,7 @@ class Permissions extends Command { }); text += `\n${total.allowed} ✅ | ${total.denied} ❌`; - message.channel.send({ + message.reply({ content: text }); } diff --git a/commands/General/report.js b/commands/General/report.js index 8c539c44..288d0901 100644 --- a/commands/General/report.js +++ b/commands/General/report.js @@ -18,7 +18,7 @@ class Report extends Command { } async run(message, args, data) { - if (message.author.id === "285109105717280768") return message.channel.send({ content: "Пошёл нахуй фахон" }); + if (message.author.id === "285109105717280768") return message.reply({ content: "Пошёл нахуй фахон" }); const repChannel = message.guild.channels.cache.get(data.guild.plugins.reports); if (!repChannel) return message.error("general/report:MISSING_CHANNEL"); diff --git a/commands/General/suggest.js b/commands/General/suggest.js index 2cf570b4..9d350c2c 100644 --- a/commands/General/suggest.js +++ b/commands/General/suggest.js @@ -18,7 +18,7 @@ class Suggest extends Command { } async run(message, args, data) { - if (message.author.id === "285109105717280768") return message.channel.send({ content: "Пошёл нахуй фахон" }); + if (message.author.id === "285109105717280768") return message.reply({ content: "Пошёл нахуй фахон" }); const suggChannel = message.guild.channels.cache.get(data.guild.plugins.suggestions); if (!suggChannel) return message.error("general/suggest:MISSING_CHANNEL"); diff --git a/commands/Images/approved.js b/commands/Images/approved.js index 964b6b27..9f9eb5bd 100644 --- a/commands/Images/approved.js +++ b/commands/Images/approved.js @@ -29,7 +29,7 @@ class Approved extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "approved.png", attachment: buffer diff --git a/commands/Images/avatar.js b/commands/Images/avatar.js index b37e8df4..f875f72a 100644 --- a/commands/Images/avatar.js +++ b/commands/Images/avatar.js @@ -24,9 +24,9 @@ class Avatar extends Command { size: 512 }); - if (args[0] === "link") return message.channel.send({ content: `<${avatarURL}>` }); + if (args[0] === "link") return message.reply({ content: `<${avatarURL}>` }); - message.channel.send({ + message.reply({ files: [{ attachment: avatarURL }] diff --git a/commands/Images/batslap.js b/commands/Images/batslap.js index b7f88a4c..991d2ab1 100644 --- a/commands/Images/batslap.js +++ b/commands/Images/batslap.js @@ -36,7 +36,7 @@ class BatSlap extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "batslap.png", attachment: buffer diff --git a/commands/Images/beautiful.js b/commands/Images/beautiful.js index 439ac670..b0aae472 100644 --- a/commands/Images/beautiful.js +++ b/commands/Images/beautiful.js @@ -29,7 +29,7 @@ class Beautiful extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "beautiful.png", attachment: buffer diff --git a/commands/Images/bed.js b/commands/Images/bed.js index 3cc41cca..a8ade40c 100644 --- a/commands/Images/bed.js +++ b/commands/Images/bed.js @@ -34,7 +34,7 @@ class Bed extends Command { })); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "bed.png", attachment: buffer diff --git a/commands/Images/brazzers.js b/commands/Images/brazzers.js index e5213ac5..c57d6be0 100644 --- a/commands/Images/brazzers.js +++ b/commands/Images/brazzers.js @@ -29,7 +29,7 @@ class Brazzers extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "brazzers.png", attachment: buffer diff --git a/commands/Images/burn.js b/commands/Images/burn.js index e4a94f7d..2e160e1d 100644 --- a/commands/Images/burn.js +++ b/commands/Images/burn.js @@ -29,7 +29,7 @@ class Burn extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "burn.png", attachment: buffer diff --git a/commands/Images/captcha.js b/commands/Images/captcha.js index 24671a21..5cb4d6fb 100644 --- a/commands/Images/captcha.js +++ b/commands/Images/captcha.js @@ -27,7 +27,7 @@ class Captcha extends Command { const json = await res.json(); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "captcha.png", attachment: json.message diff --git a/commands/Images/challenger.js b/commands/Images/challenger.js index edb82b1e..f4dfd693 100644 --- a/commands/Images/challenger.js +++ b/commands/Images/challenger.js @@ -29,7 +29,7 @@ class Challenger extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "challenger.png", attachment: buffer diff --git a/commands/Images/clyde.js b/commands/Images/clyde.js index ceb706a4..ddaf1d58 100644 --- a/commands/Images/clyde.js +++ b/commands/Images/clyde.js @@ -28,7 +28,7 @@ class Clyde extends Command { try { const res = await fetch(encodeURI(`https://nekobot.xyz/api/imagegen?type=clyde&text=${text}`)); const json = await res.json(); - message.channel.send({ + message.reply({ files: [{ name: "clyde.png", attachment: json.message diff --git a/commands/Images/crush.js b/commands/Images/crush.js index de46829d..c89e5c25 100644 --- a/commands/Images/crush.js +++ b/commands/Images/crush.js @@ -29,7 +29,7 @@ class Crush extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "crush.png", attachment: buffer diff --git a/commands/Images/dictator.js b/commands/Images/dictator.js index fcdd13ce..2ccbc6e5 100644 --- a/commands/Images/dictator.js +++ b/commands/Images/dictator.js @@ -29,7 +29,7 @@ class Dictator extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "dictator.png", attachment: buffer diff --git a/commands/Images/facepalm.js b/commands/Images/facepalm.js index 5c27bfd0..d08e8575 100644 --- a/commands/Images/facepalm.js +++ b/commands/Images/facepalm.js @@ -43,7 +43,7 @@ class Facepalm extends Command { m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "facepalm.png", attachment: canvas.toBuffer() diff --git a/commands/Images/fire.js b/commands/Images/fire.js index 43b96615..d7f2851b 100644 --- a/commands/Images/fire.js +++ b/commands/Images/fire.js @@ -29,7 +29,7 @@ class Fire extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "fire.png", attachment: buffer diff --git a/commands/Images/jail.js b/commands/Images/jail.js index 04f79131..b8b50c07 100644 --- a/commands/Images/jail.js +++ b/commands/Images/jail.js @@ -29,7 +29,7 @@ class Jail extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "jail.png", attachment: buffer diff --git a/commands/Images/love.js b/commands/Images/love.js index 9bd20b32..63cad35f 100644 --- a/commands/Images/love.js +++ b/commands/Images/love.js @@ -29,7 +29,7 @@ class Love extends Command { try { const res = await fetch(encodeURI(`https://nekobot.xyz/api/imagegen?type=ship&user1=${users[0].displayAvatarURL({ format: "png", size: 512 })}&user2=${users[1].displayAvatarURL({ format: "png", size: 512 })}`)); const json = await res.json(); - message.channel.send({ + message.reply({ files: [{ name: "love.png", attachment: json.message diff --git a/commands/Images/magik.js b/commands/Images/magik.js index cede2f8c..edf3499a 100644 --- a/commands/Images/magik.js +++ b/commands/Images/magik.js @@ -29,7 +29,7 @@ class Magik extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "magik.png", attachment: buffer diff --git a/commands/Images/mission.js b/commands/Images/mission.js index 8f09251f..13088b0b 100644 --- a/commands/Images/mission.js +++ b/commands/Images/mission.js @@ -29,7 +29,7 @@ class Mission extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "mission.png", attachment: buffer diff --git a/commands/Images/phcomment.js b/commands/Images/phcomment.js index 40ae3ea4..42dd77bd 100644 --- a/commands/Images/phcomment.js +++ b/commands/Images/phcomment.js @@ -40,7 +40,7 @@ class Phcomment extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "phcomment.png", attachment: buffer diff --git a/commands/Images/ps4.js b/commands/Images/ps4.js index d46098a9..42641627 100644 --- a/commands/Images/ps4.js +++ b/commands/Images/ps4.js @@ -29,7 +29,7 @@ class Ps4 extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "ps4.png", attachment: buffer diff --git a/commands/Images/rip.js b/commands/Images/rip.js index 3be814cf..b6645d71 100644 --- a/commands/Images/rip.js +++ b/commands/Images/rip.js @@ -29,7 +29,7 @@ class Rip extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "rip.png", attachment: buffer diff --git a/commands/Images/scary.js b/commands/Images/scary.js index 1960f037..80afea39 100644 --- a/commands/Images/scary.js +++ b/commands/Images/scary.js @@ -29,7 +29,7 @@ class Scary extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "scary.png", attachment: buffer diff --git a/commands/Images/steamcard.js b/commands/Images/steamcard.js index 770f6f98..6f47aa38 100644 --- a/commands/Images/steamcard.js +++ b/commands/Images/steamcard.js @@ -33,7 +33,7 @@ class SteamCard extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "steamcard.png", attachment: buffer diff --git a/commands/Images/tobecontinued.js b/commands/Images/tobecontinued.js index c7896b16..5f9e3afa 100644 --- a/commands/Images/tobecontinued.js +++ b/commands/Images/tobecontinued.js @@ -29,7 +29,7 @@ class Tobecontinued extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "tobecontinued.png", attachment: buffer diff --git a/commands/Images/trash.js b/commands/Images/trash.js index 76e9616f..c417beb6 100644 --- a/commands/Images/trash.js +++ b/commands/Images/trash.js @@ -28,7 +28,7 @@ class Trash extends Command { })); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "trash.png", attachment: buffer diff --git a/commands/Images/triggered.js b/commands/Images/triggered.js index 7d0cf87d..43366e15 100644 --- a/commands/Images/triggered.js +++ b/commands/Images/triggered.js @@ -29,7 +29,7 @@ class Triggered extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "triggered.gif", attachment: buffer diff --git a/commands/Images/wanted.js b/commands/Images/wanted.js index 6096e713..85df9457 100644 --- a/commands/Images/wanted.js +++ b/commands/Images/wanted.js @@ -29,7 +29,7 @@ class Wanted extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "wanted.png", attachment: buffer diff --git a/commands/Images/wasted.js b/commands/Images/wasted.js index 982da7b6..6e9bf472 100644 --- a/commands/Images/wasted.js +++ b/commands/Images/wasted.js @@ -29,7 +29,7 @@ class Wasted extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "wasted.png", attachment: buffer diff --git a/commands/Images/youtube-comment.js b/commands/Images/youtube-comment.js index 117debb0..dafe2c7e 100644 --- a/commands/Images/youtube-comment.js +++ b/commands/Images/youtube-comment.js @@ -38,7 +38,7 @@ class Ytcomment extends Command { }); m.delete(); - message.channel.send({ + message.reply({ files: [{ name: "ytcomment.png", attachment: image diff --git a/commands/Moderation/announcement.js b/commands/Moderation/announcement.js index 62340c1c..e6a604bc 100644 --- a/commands/Moderation/announcement.js +++ b/commands/Moderation/announcement.js @@ -23,7 +23,7 @@ class Announcement extends Command { if (text.length > 1030) return message.error("moderation/announcement:TOO_LONG"); let mention = null; - const msg = await message.channel.send(message.translate("moderation/announcement:MENTION_PROMPT")); + const msg = await message.sendT("moderation/announcement:MENTION_PROMPT"); const filter = m => m.author.id === message.author.id; const collector = new Discord.MessageCollector(message.channel, { diff --git a/commands/Moderation/ban.js b/commands/Moderation/ban.js index 6c23ceec..16090e9c 100644 --- a/commands/Moderation/ban.js +++ b/commands/Moderation/ban.js @@ -58,12 +58,14 @@ class Ban extends Command { reason }).then(() => { // Send a success message in the current channel - message.channel.send(message.translate("moderation/ban:BANNED", { - username: user.tag, - server: message.guild.name, - moderator: message.author.tag, - reason - })); + message.reply({ + content: message.translate("moderation/ban:BANNED", { + username: user.tag, + server: message.guild.name, + moderator: message.author.tag, + reason + }) + }); const caseInfo = { channel: message.channel.id, diff --git a/commands/Moderation/kick.js b/commands/Moderation/kick.js index 6b6019c9..c2fbee21 100644 --- a/commands/Moderation/kick.js +++ b/commands/Moderation/kick.js @@ -37,22 +37,26 @@ class Kick extends Command { if (message.member.ownerId !== message.author.id && !(moderationPosition > memberPosition)) return message.error("moderation/ban:SUPERIOR"); if (!member.kickable) return message.error("moderation/kick:MISSING_PERM"); - await member.send(message.translate("moderation/kick:KICKED_DM", { - username: member.user.tag, - server: message.guild.name, - moderator: message.author.tag, - reason - })).catch(() => {}); - - // Kick the user - member.kick(reason).then(() => { - // Send a success message in the current channel - message.channel.send(message.translate("moderation/kick:KICKED", { + await member.send({ + content: message.translate("moderation/kick:KICKED_DM", { username: member.user.tag, server: message.guild.name, moderator: message.author.tag, reason - })); + }) + }); + + // Kick the user + member.kick(reason).then(() => { + // Send a success message in the current channel + message.reply({ + content: message.translate("moderation/kick:KICKED", { + username: member.user.tag, + server: message.guild.name, + moderator: message.author.tag, + reason + }) + }); data.guild.casesCount++; data.guild.save(); diff --git a/commands/Moderation/mute.js b/commands/Moderation/mute.js index 0a13a2e9..b952fbb2 100644 --- a/commands/Moderation/mute.js +++ b/commands/Moderation/mute.js @@ -45,13 +45,15 @@ class Mute extends Command { }).catch(() => {}); }); - member.send(message.translate("moderation/mute:MUTED_DM", { - username: member.user.username, - server: message.guild.name, - moderator: message.author.tag, - time, - reason - })); + member.send({ + content: message.translate("moderation/mute:MUTED_DM", { + username: member.user.username, + server: message.guild.name, + moderator: message.author.tag, + time, + reason + }) + }); message.success("moderation/mute:MUTED", { username: member.user.tag, diff --git a/commands/Moderation/poll.js b/commands/Moderation/poll.js index bfcaf5df..070c607e 100644 --- a/commands/Moderation/poll.js +++ b/commands/Moderation/poll.js @@ -22,7 +22,7 @@ class Poll extends Command { if (!question) return message.error("moderation/poll:MISSING_QUESTION"); let mention = null; - const msg = await message.channel.send(message.translate("moderation/announcement:MENTION_PROMPT")); + const msg = await message.sendT("moderation/announcement:MENTION_PROMPT"); const filter = m => m.author.id === message.author.id; const collector = new Discord.MessageCollector(message.channel, { diff --git a/commands/Moderation/warn.js b/commands/Moderation/warn.js index 73a0fc42..698978fc 100644 --- a/commands/Moderation/warn.js +++ b/commands/Moderation/warn.js @@ -60,12 +60,14 @@ class Warn extends Command { if (banCount) { if (sanctions >= banCount) { - member.send(message.translate("moderation/ban:BANNED_DM", { - username: member.user, - moderator: message.author.tag, - server: message.guild.name, - reason - })); + member.send({ + content: message.translate("moderation/ban:BANNED_DM", { + username: member.user, + moderator: message.author.tag, + server: message.guild.name, + reason + }) + }); caseInfo.type = "ban"; embed.setAuthor({ name: message.translate("moderation/ban:CASE", { @@ -83,12 +85,14 @@ class Warn extends Command { if (kickCount) { if (sanctions >= kickCount) { - member.send(message.translate("moderation/kick:KICKED_DM", { - username: member.user, - moderator: message.author.tag, - server: message.guild.name, - reason - })); + member.send({ + content: message.translate("moderation/kick:KICKED_DM", { + username: member.user, + moderator: message.author.tag, + server: message.guild.name, + reason + }) + }); caseInfo.type = "kick"; embed.setAuthor({ name: message.translate("moderation/kick:CASE", { @@ -104,12 +108,14 @@ class Warn extends Command { } } - member.send(message.translate("moderation/warn:WARNED_DM", { - username: member.user.tag, - server: message.guild.name, - moderator: message.author.tag, - reason - })); + member.send({ + content: message.translate("moderation/warn:WARNED_DM", { + username: member.user.tag, + server: message.guild.name, + moderator: message.author.tag, + reason + }) + }); caseInfo.type = "warn"; embed.setAuthor({ name: message.translate("moderation/warn:CASE", { diff --git a/commands/Owner/eval.js b/commands/Owner/eval.js index 7f71915f..ceb54199 100644 --- a/commands/Owner/eval.js +++ b/commands/Owner/eval.js @@ -26,14 +26,14 @@ class Eval extends Command { depth: 0 }); if (output.includes(this.client.token)) output = output.replace(this.client.token, "T0K3N"); - message.channel.send({ + message.reply({ content: "```js\n" + output + "```" }); }).catch((err) => { console.error(err); err = err.toString(); if (err.includes(this.client.token)) err = err.replace(this.client.token, "T0K3N"); - message.channel.send({ + message.reply({ content: "```js\n" + err + "```" }); });