mirror of
https://github.com/danbulant/Shasha
synced 2026-06-07 16:43:02 +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 {
|
} else {
|
||||||
if (/^\d{17,19}$/.test(ID)) {
|
if (/^\d{17,19}$/.test(ID)) {
|
||||||
channel = msg.guild.channels.cache.get(ID);
|
channel = msg.guild.channels.cache.get(ID);
|
||||||
if (!channel) {
|
if (!channel && this.client.owners.includes(msg.author.id)) {
|
||||||
if (this.client.owners.includes(msg.author.id)) {
|
channel = this.client.channels.cache.get(ID);
|
||||||
channel = this.client.channels.cache.get(ID);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
channel = findChannelRegEx(msg, ID, ["category", "voice"])[0];
|
channel = findChannelRegEx(msg, ID, ["category", "voice"])[0];
|
||||||
|
|
|
||||||
|
|
@ -24,17 +24,15 @@ module.exports = class send extends commando.Command {
|
||||||
let channel;
|
let channel;
|
||||||
if (/^\d{17,19}$/.test(search)) {
|
if (/^\d{17,19}$/.test(search)) {
|
||||||
channel = msg.guild.channels.cache.get(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) {
|
if (!channel) {
|
||||||
channel = findChannelRegEx(msg, search, ["category", "voice"])[0];
|
channel = findChannelRegEx(msg, search, ["category", "voice"])[0];
|
||||||
if (!channel) {
|
}
|
||||||
if (this.client.owners.includes(msg.author)) {
|
if (!channel) {
|
||||||
channel = this.client.channels.cache.get(search);
|
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")) {
|
if (!channel.permissionsFor(msg.author).has("SEND_MESSAGES") || !channel.permissionsFor(msg.author).has("VIEW_CHANNEL")) {
|
||||||
return trySend(this.client, msg, "No <:cathmmLife:772716381874946068>");
|
return trySend(this.client, msg, "No <:cathmmLife:772716381874946068>");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue