mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 13:14:58 +05:00
Фиксы
This commit is contained in:
parent
cffb648f6a
commit
a46de830fb
1 changed files with 23 additions and 20 deletions
|
@ -17,7 +17,9 @@ class Say extends Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(message, args) {
|
async run(message, args) {
|
||||||
if (!args[0]) return message.delete();
|
if (!args[0]) {
|
||||||
|
if (message.deletable) return message.delete();
|
||||||
|
}
|
||||||
|
|
||||||
// Arguments split
|
// Arguments split
|
||||||
const split = "++";
|
const split = "++";
|
||||||
|
@ -27,8 +29,25 @@ class Say extends Command {
|
||||||
let attachment = null;
|
let attachment = null;
|
||||||
if (message.attachments.size > 0) attachment = message.attachments.first();
|
if (message.attachments.size > 0) attachment = message.attachments.first();
|
||||||
|
|
||||||
if (args[1] && !args[2]) {
|
if (!args[1] && !args[2]) {
|
||||||
message.delete();
|
if (message.deletable) message.delete();
|
||||||
|
const saychannel = message.channel;
|
||||||
|
saychannel.sendTyping();
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
if (attachment) saychannel.send({
|
||||||
|
content: args[0],
|
||||||
|
files: [{
|
||||||
|
name: attachment.name,
|
||||||
|
attachment: attachment.url
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
else saychannel.send({
|
||||||
|
content: args[0]
|
||||||
|
});
|
||||||
|
}, 2000);
|
||||||
|
} else if (args[1] && !args[2]) {
|
||||||
|
if (message.deletable) message.delete();
|
||||||
const saychannel = message.guild.channels.cache.find(channel => channel.name == args[1] || channel.id == args[1]);
|
const saychannel = message.guild.channels.cache.find(channel => channel.name == args[1] || channel.id == args[1]);
|
||||||
saychannel.sendTyping();
|
saychannel.sendTyping();
|
||||||
|
|
||||||
|
@ -45,26 +64,10 @@ class Say extends Command {
|
||||||
});
|
});
|
||||||
}, 2000);
|
}, 2000);
|
||||||
} else if (args[2]) {
|
} else if (args[2]) {
|
||||||
|
if (message.deletable) message.delete();
|
||||||
const saychannel = this.client.guilds.cache.find(guild => guild.name == args[2] || guild.id == args[2]).channels.cache.find(channel => channel.name == args[1] || channel.id == args[1]);
|
const saychannel = this.client.guilds.cache.find(guild => guild.name == args[2] || guild.id == args[2]).channels.cache.find(channel => channel.name == args[1] || channel.id == args[1]);
|
||||||
saychannel.sendTyping();
|
saychannel.sendTyping();
|
||||||
|
|
||||||
setTimeout(function () {
|
|
||||||
if (attachment) saychannel.send({
|
|
||||||
content: args[0],
|
|
||||||
files: [{
|
|
||||||
name: attachment.name,
|
|
||||||
attachment: attachment.url
|
|
||||||
}]
|
|
||||||
});
|
|
||||||
else saychannel.send({
|
|
||||||
content: args[0]
|
|
||||||
});
|
|
||||||
}, 2000);
|
|
||||||
} else {
|
|
||||||
message.delete();
|
|
||||||
const saychannel = message.channel;
|
|
||||||
saychannel.sendTyping();
|
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
if (attachment) saychannel.send({
|
if (attachment) saychannel.send({
|
||||||
content: args[0],
|
content: args[0],
|
||||||
|
|
Loading…
Reference in a new issue