mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 05:04: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) return message.error("moderation/announcement:MISSING_TEXT");
|
||||||
if (text.length > 1030) return message.error("moderation/announcement:TOO_LONG");
|
if (text.length > 1030) return message.error("moderation/announcement:TOO_LONG");
|
||||||
|
|
||||||
message.delete().catch(() => {});
|
|
||||||
|
|
||||||
let mention = null;
|
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 filter = m => m.author.id === message.author.id;
|
||||||
const collector = new Discord.MessageCollector(message.channel, {
|
const collector = new Discord.MessageCollector(message.channel, {
|
||||||
|
@ -38,12 +36,14 @@ class Announcement extends Command {
|
||||||
tmsg.delete();
|
tmsg.delete();
|
||||||
msg.delete();
|
msg.delete();
|
||||||
collector.stop(true);
|
collector.stop(true);
|
||||||
|
|
||||||
|
message.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmsg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) {
|
if (tmsg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) {
|
||||||
tmsg.delete();
|
tmsg.delete();
|
||||||
msg.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 filter = m => m.author.id === message.author.id;
|
||||||
const c = new Discord.MessageCollector(message.channel, {
|
const c = new Discord.MessageCollector(message.channel, {
|
||||||
|
@ -65,9 +65,12 @@ class Announcement extends Command {
|
||||||
c.stop(true);
|
c.stop(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
c.on("end", (collected, reason) => {
|
c.on("end", (collected, reason) => {
|
||||||
if (reason === "time") return message.error("misc:TIMES_UP");
|
if (reason === "time") return message.error("misc:TIMES_UP");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
message.delete();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -58,12 +58,12 @@ class Ban extends Command {
|
||||||
reason
|
reason
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
// Send a success message in the current channel
|
// Send a success message in the current channel
|
||||||
message.sendT("moderation/ban:BANNED", {
|
message.channel.send(message.translate("moderation/ban:BANNED", {
|
||||||
username: user.tag,
|
username: user.tag,
|
||||||
server: message.guild.name,
|
server: message.guild.name,
|
||||||
moderator: message.author.tag,
|
moderator: message.author.tag,
|
||||||
reason
|
reason
|
||||||
});
|
}));
|
||||||
|
|
||||||
const caseInfo = {
|
const caseInfo = {
|
||||||
channel: message.channel.id,
|
channel: message.channel.id,
|
||||||
|
|
|
@ -18,7 +18,8 @@ class Clear extends Command {
|
||||||
|
|
||||||
async run(message, args) {
|
async run(message, args) {
|
||||||
if (args[0] === "all") {
|
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"), {
|
await message.channel.awaitMessages((m) => (m.author.id === message.author.id) && (m.content === "confirm"), {
|
||||||
max: 1,
|
max: 1,
|
||||||
time: 20000,
|
time: 20000,
|
||||||
|
@ -26,6 +27,7 @@ class Clear extends Command {
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
return message.error("misc:TIMES_UP");
|
return message.error("misc:TIMES_UP");
|
||||||
});
|
});
|
||||||
|
|
||||||
const position = message.channel.position;
|
const position = message.channel.position;
|
||||||
const newChannel = await message.channel.clone();
|
const newChannel = await message.channel.clone();
|
||||||
await message.channel.delete();
|
await message.channel.delete();
|
||||||
|
|
|
@ -47,12 +47,12 @@ class Kick extends Command {
|
||||||
// Kick the user
|
// Kick the user
|
||||||
member.kick(reason).then(() => {
|
member.kick(reason).then(() => {
|
||||||
// Send a success message in the current channel
|
// 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,
|
username: member.user.tag,
|
||||||
server: message.guild.name,
|
server: message.guild.name,
|
||||||
moderator: message.author.tag,
|
moderator: message.author.tag,
|
||||||
reason
|
reason
|
||||||
});
|
}));
|
||||||
|
|
||||||
data.guild.casesCount++;
|
data.guild.casesCount++;
|
||||||
data.guild.save();
|
data.guild.save();
|
||||||
|
|
|
@ -22,7 +22,7 @@ class Poll extends Command {
|
||||||
if (!question) return message.error("moderation/poll:MISSING_QUESTION");
|
if (!question) return message.error("moderation/poll:MISSING_QUESTION");
|
||||||
|
|
||||||
let mention = null;
|
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 filter = m => m.author.id === message.author.id;
|
||||||
const collector = new Discord.MessageCollector(message.channel, {
|
const collector = new Discord.MessageCollector(message.channel, {
|
||||||
|
@ -42,7 +42,7 @@ class Poll extends Command {
|
||||||
if (tmsg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) {
|
if (tmsg.content.toLowerCase() === message.translate("common:YES").toLowerCase()) {
|
||||||
tmsg.delete();
|
tmsg.delete();
|
||||||
msg.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 filter = m => m.author.id === message.author.id;
|
||||||
const c = new Discord.MessageCollector(message.channel, {
|
const c = new Discord.MessageCollector(message.channel, {
|
||||||
|
|
|
@ -200,7 +200,7 @@ module.exports = class {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
cmd.run(message, args, data);
|
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) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
return message.error("misc:ERR_OCCURRED");
|
return message.error("misc:ERR_OCCURRED");
|
||||||
|
|
Loading…
Reference in a new issue