mirror of
https://github.com/danbulant/Shasha
synced 2026-05-24 12:22:00 +00:00
shorter fetch channel function
This commit is contained in:
parent
2f247ddaa9
commit
2aeb498e36
2 changed files with 8 additions and 12 deletions
|
|
@ -276,10 +276,8 @@ module.exports = class embmaker extends commando.Command {
|
|||
} else {
|
||||
if (/^\d{17,19}$/.test(ID)) {
|
||||
channel = msg.guild.channels.cache.get(ID);
|
||||
if (!channel) {
|
||||
if (this.client.owners.includes(msg.author.id)) {
|
||||
channel = this.client.channels.cache.get(ID);
|
||||
}
|
||||
if (!channel && this.client.owners.includes(msg.author.id)) {
|
||||
channel = this.client.channels.cache.get(ID);
|
||||
}
|
||||
} else {
|
||||
channel = findChannelRegEx(msg, ID, ["category", "voice"])[0];
|
||||
|
|
|
|||
|
|
@ -24,17 +24,15 @@ module.exports = class send extends commando.Command {
|
|||
let channel;
|
||||
if (/^\d{17,19}$/.test(search)) {
|
||||
channel = msg.guild.channels.cache.get(search);
|
||||
if (!channel && this.client.owners.includes(msg.author)) {
|
||||
channel = this.client.channels.cache.get(search);
|
||||
}
|
||||
}
|
||||
if (!channel) {
|
||||
channel = findChannelRegEx(msg, search, ["category", "voice"])[0];
|
||||
if (!channel) {
|
||||
if (this.client.owners.includes(msg.author)) {
|
||||
channel = this.client.channels.cache.get(search);
|
||||
}
|
||||
if (!channel) {
|
||||
return trySend(this.client, msg, "That channel is like your gf. Doesn't exist <:cathmmLife:772716381874946068>");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!channel) {
|
||||
return trySend(this.client, msg, "That channel is like your gf. Doesn't exist <:cathmmLife:772716381874946068>");
|
||||
}
|
||||
if (!channel.permissionsFor(msg.author).has("SEND_MESSAGES") || !channel.permissionsFor(msg.author).has("VIEW_CHANNEL")) {
|
||||
return trySend(this.client, msg, "No <:cathmmLife:772716381874946068>");
|
||||
|
|
|
|||
Loading…
Reference in a new issue