mirror of
https://github.com/danbulant/Shasha
synced 2026-06-09 09:30:47 +00:00
little change, use double dash argument
This commit is contained in:
parent
a2984d02c0
commit
8dd4dcff52
1 changed files with 14 additions and 13 deletions
|
|
@ -34,13 +34,12 @@ module.exports = class lookup extends commando.Command {
|
||||||
const args = arg.split(/ +/);
|
const args = arg.split(/ +/);
|
||||||
let [fetchedMember, fetchedRoles, fetchedChannels, memMes] = [[], [], [], ""];
|
let [fetchedMember, fetchedRoles, fetchedChannels, memMes] = [[], [], [], ""];
|
||||||
const lowCaseArg0 = args[0].toLowerCase();
|
const lowCaseArg0 = args[0].toLowerCase();
|
||||||
if (lowCaseArg0 === "role") {
|
if (lowCaseArg0 === "--role") {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
const cleanRoleID = cleanMentionID(arg.slice("role".length).trim());
|
const cleanRoleID = cleanMentionID(arg.slice("--role".length).trim());
|
||||||
if (!/\D/.test(cleanRoleID)) {
|
if (/^\d{17,19}$/.test(cleanRoleID)) {
|
||||||
fetchedRoles.push(msg.guild.roles.cache.get(cleanRoleID));
|
fetchedRoles.push(msg.guild.roles.cache.get(cleanRoleID));
|
||||||
}
|
} else {
|
||||||
if (/\D/.test(cleanRoleID) || fetchedRoles[0] == null) {
|
|
||||||
fetchedRoles = findRoleRegEx(msg, cleanRoleID);
|
fetchedRoles = findRoleRegEx(msg, cleanRoleID);
|
||||||
}
|
}
|
||||||
if (fetchedRoles.length > 1) {
|
if (fetchedRoles.length > 1) {
|
||||||
|
|
@ -53,13 +52,12 @@ module.exports = class lookup extends commando.Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (lowCaseArg0 === "channel") {
|
if (lowCaseArg0 === "--channel") {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
const cleanChannelID = cleanMentionID(arg.slice("channel".length).trim());
|
const cleanChannelID = cleanMentionID(arg.slice("--channel".length).trim());
|
||||||
if (!/\D/.test(cleanChannelID)) {
|
if (/^\d{17,19}$/.test(cleanChannelID)) {
|
||||||
fetchedChannels.push(msg.guild.roles.cache.get(cleanChannelID));
|
fetchedChannels.push(msg.guild.roles.cache.get(cleanChannelID));
|
||||||
}
|
} else {
|
||||||
if (/\D/.test(cleanChannelID) || fetchedChannels[0] == null) {
|
|
||||||
fetchedChannels = findChannelRegEx(msg, cleanChannelID);
|
fetchedChannels = findChannelRegEx(msg, cleanChannelID);
|
||||||
}
|
}
|
||||||
if (fetchedChannels.length > 1) {
|
if (fetchedChannels.length > 1) {
|
||||||
|
|
@ -72,10 +70,13 @@ module.exports = class lookup extends commando.Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!/\D/.test(arg)) {
|
if (arg.toLowerCase().startsWith("--member")) {
|
||||||
fetchedMember.push(msg.guild.member(arg));
|
arg = arg.slice("--members".length).trim();
|
||||||
}
|
}
|
||||||
if (/\D/.test(arg) || fetchedMember[0] === null) {
|
arg = cleanMentionID(arg);
|
||||||
|
if (/^\d{17,19}$/.test(arg)) {
|
||||||
|
fetchedMember.push(msg.guild.member(arg));
|
||||||
|
} else {
|
||||||
fetchedMember = findMemberRegEx(msg, arg);
|
fetchedMember = findMemberRegEx(msg, arg);
|
||||||
}
|
}
|
||||||
if (fetchedMember.length > 1) {
|
if (fetchedMember.length > 1) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue