mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-21 20:54:58 +05:00
Фиксыыыы
This commit is contained in:
parent
744b4e1f01
commit
84868cfe64
6 changed files with 17 additions and 12 deletions
|
@ -22,10 +22,8 @@ class Announcement extends Command {
|
|||
if (!text) return message.error("moderation/announcement:MISSING_TEXT");
|
||||
if (text.length > 1030) return message.error("moderation/announcement:TOO_LONG");
|
||||
|
||||
message.delete().catch(() => {});
|
||||
|
||||
let mention = null;
|
||||
const msg = await message.sendT("moderation/announcement:MENTION_PROMPT");
|
||||
const msg = await message.channel.send(message.translate("moderation/announcement:MENTION_PROMPT"));
|
||||
|
||||
const filter = m => m.author.id === message.author.id;
|
||||
const collector = new Discord.MessageCollector(message.channel, {
|
||||
|
@ -38,12 +36,14 @@ class Announcement extends Command {
|
|||
tmsg.delete();
|
||||
msg.delete();
|
||||
collector.stop(true);
|
||||
|
||||
message.delete();
|
||||
}
|
||||
|
||||
if (tmsg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) {
|
||||
tmsg.delete();
|
||||
msg.delete();
|
||||
const tmsg1 = await message.sendT("moderation/announcement:MENTION_TYPE_PROMPT");
|
||||
const tmsg1 = await message.channel.send(message.translate("moderation/announcement:MENTION_TYPE_PROMPT"));
|
||||
|
||||
const filter = m => m.author.id === message.author.id;
|
||||
const c = new Discord.MessageCollector(message.channel, {
|
||||
|
@ -65,9 +65,12 @@ class Announcement extends Command {
|
|||
c.stop(true);
|
||||
}
|
||||
});
|
||||
|
||||
c.on("end", (collected, reason) => {
|
||||
if (reason === "time") return message.error("misc:TIMES_UP");
|
||||
});
|
||||
|
||||
message.delete();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -58,12 +58,12 @@ class Ban extends Command {
|
|||
reason
|
||||
}).then(() => {
|
||||
// Send a success message in the current channel
|
||||
message.sendT("moderation/ban:BANNED", {
|
||||
message.channel.send(message.translate("moderation/ban:BANNED", {
|
||||
username: user.tag,
|
||||
server: message.guild.name,
|
||||
moderator: message.author.tag,
|
||||
reason
|
||||
});
|
||||
}));
|
||||
|
||||
const caseInfo = {
|
||||
channel: message.channel.id,
|
||||
|
|
|
@ -18,7 +18,8 @@ class Clear extends Command {
|
|||
|
||||
async run(message, args) {
|
||||
if (args[0] === "all") {
|
||||
message.sendT("moderation/clear:ALL_CONFIRM");
|
||||
message.channel.send(message.translate("moderation/clear:ALL_CONFIRM"));
|
||||
|
||||
await message.channel.awaitMessages((m) => (m.author.id === message.author.id) && (m.content === "confirm"), {
|
||||
max: 1,
|
||||
time: 20000,
|
||||
|
@ -26,6 +27,7 @@ class Clear extends Command {
|
|||
}).catch(() => {
|
||||
return message.error("misc:TIMES_UP");
|
||||
});
|
||||
|
||||
const position = message.channel.position;
|
||||
const newChannel = await message.channel.clone();
|
||||
await message.channel.delete();
|
||||
|
|
|
@ -47,12 +47,12 @@ class Kick extends Command {
|
|||
// Kick the user
|
||||
member.kick(reason).then(() => {
|
||||
// Send a success message in the current channel
|
||||
message.sendT("moderation/kick:KICKED", {
|
||||
message.channel.send(message.translate("moderation/kick:KICKED", {
|
||||
username: member.user.tag,
|
||||
server: message.guild.name,
|
||||
moderator: message.author.tag,
|
||||
reason
|
||||
});
|
||||
}));
|
||||
|
||||
data.guild.casesCount++;
|
||||
data.guild.save();
|
||||
|
|
|
@ -22,7 +22,7 @@ class Poll extends Command {
|
|||
if (!question) return message.error("moderation/poll:MISSING_QUESTION");
|
||||
|
||||
let mention = null;
|
||||
const msg = await message.sendT("moderation/announcement:MENTION_PROMPT");
|
||||
const msg = await message.channel.send(message.translate("moderation/announcement:MENTION_PROMPT"));
|
||||
|
||||
const filter = m => m.author.id === message.author.id;
|
||||
const collector = new Discord.MessageCollector(message.channel, {
|
||||
|
@ -42,7 +42,7 @@ class Poll extends Command {
|
|||
if (tmsg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) {
|
||||
tmsg.delete();
|
||||
msg.delete();
|
||||
const tmsg1 = await message.sendT("moderation/announcement:MENTION_TYPE_PROMPT");
|
||||
const tmsg1 = await message.channel.send(message.translate("moderation/announcement:MENTION_TYPE_PROMPT"));
|
||||
|
||||
const filter = m => m.author.id === message.author.id;
|
||||
const c = new Discord.MessageCollector(message.channel, {
|
||||
|
|
|
@ -200,7 +200,7 @@ module.exports = class {
|
|||
|
||||
try {
|
||||
cmd.run(message, args, data);
|
||||
if (cmd.help.category === "Moderation" && data.guild.autoDeleteModCommands) message.delete();
|
||||
if (cmd.help.category === "Moderation" && data.guild.autoDeleteModCommands) setTimeout(() => message.delete(), 3000);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return message.error("misc:ERR_OCCURRED");
|
||||
|
|
Loading…
Reference in a new issue