mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-25 14:44:58 +05:00
Мелкие правки
This commit is contained in:
parent
3654e0a53d
commit
ff25621352
1 changed files with 13 additions and 12 deletions
|
@ -27,56 +27,57 @@ class Say extends Command {
|
||||||
for (let i = 0; i < args.length; i++) args[i] = args[i].trim();
|
for (let i = 0; i < args.length; i++) args[i] = args[i].trim();
|
||||||
|
|
||||||
let attachment = null;
|
let attachment = null;
|
||||||
|
let sayChannel = 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]) {
|
||||||
if (message.deletable) message.delete();
|
if (message.deletable) message.delete();
|
||||||
const saychannel = message.channel;
|
sayChannel = message.channel;
|
||||||
saychannel.sendTyping();
|
sayChannel.sendTyping();
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
if (attachment) saychannel.send({
|
if (attachment) sayChannel.send({
|
||||||
content: args[0],
|
content: args[0],
|
||||||
files: [{
|
files: [{
|
||||||
name: attachment.name,
|
name: attachment.name,
|
||||||
attachment: attachment.url
|
attachment: attachment.url
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
else saychannel.send({
|
else sayChannel.send({
|
||||||
content: args[0]
|
content: args[0]
|
||||||
});
|
});
|
||||||
}, 2000);
|
}, 2000);
|
||||||
} else if (args[1] && !args[2]) {
|
} else if (args[1] && !args[2]) {
|
||||||
if (message.deletable) message.delete();
|
if (message.deletable) message.delete();
|
||||||
const saychannel = message.guild.channels.cache.find(channel => channel.name == args[1] || channel.id == args[1]);
|
sayChannel = message.guild.channels.cache.find(channel => channel.name.includes(args[1]) || channel.id === args[1]);
|
||||||
saychannel.sendTyping();
|
sayChannel.sendTyping();
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
if (attachment) saychannel.send({
|
if (attachment) sayChannel.send({
|
||||||
content: args[0],
|
content: args[0],
|
||||||
files: [{
|
files: [{
|
||||||
name: attachment.name,
|
name: attachment.name,
|
||||||
attachment: attachment.url
|
attachment: attachment.url
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
else saychannel.send({
|
else sayChannel.send({
|
||||||
content: args[0]
|
content: args[0]
|
||||||
});
|
});
|
||||||
}, 2000);
|
}, 2000);
|
||||||
} else if (args[2]) {
|
} else if (args[2]) {
|
||||||
if (message.deletable) message.delete();
|
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]);
|
sayChannel = this.client.guilds.cache.find(guild => guild.name.includes(args[2]) || guild.id === args[2]).channels.cache.find(channel => channel.name.includes(args[1]) || channel.id === args[1]);
|
||||||
saychannel.sendTyping();
|
sayChannel.sendTyping();
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
if (attachment) saychannel.send({
|
if (attachment) sayChannel.send({
|
||||||
content: args[0],
|
content: args[0],
|
||||||
files: [{
|
files: [{
|
||||||
name: attachment.name,
|
name: attachment.name,
|
||||||
attachment: attachment.url
|
attachment: attachment.url
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
else saychannel.send({
|
else sayChannel.send({
|
||||||
content: args[0]
|
content: args[0]
|
||||||
});
|
});
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|
Loading…
Reference in a new issue