fix(ESLint)

This commit is contained in:
March 7th 2022-08-01 13:02:58 +07:00
parent 171f2b1af9
commit 8119666bcb
4 changed files with 1065 additions and 1409 deletions

View File

@ -628,10 +628,10 @@ class ApplicationCommand extends Base {
option_[0] = {
type: ApplicationCommandOptionTypes[subCommand.type],
name: subCommand.name,
options: optionFormat.filter(obj => obj.value),
options: optionFormat.filter(obj => obj.value !== undefined),
};
} else {
option_ = optionFormat.filter(obj => obj.value);
option_ = optionFormat.filter(obj => obj.value !== undefined);
}
// Autoresponse
const getAutoResponse = async (options_, type, name, value) => {
@ -717,8 +717,9 @@ class ApplicationCommand extends Base {
type: ApplicationCommandOptionTypes[this.options[i].type],
name: this.options[i].name,
value:
choice?.value || value == undefined ? undefined :
(this.options[i].type == 'ATTACHMENT'
choice?.value || value == undefined
? value
: this.options[i].type == 'ATTACHMENT'
? await addDataFromAttachment(value)
: this.options[i].type == 'INTEGER'
? Number(value)
@ -731,7 +732,7 @@ class ApplicationCommand extends Base {
this.options[i].name,
value,
)
: value),
: value,
};
optionFormat.push(data);
} else {
@ -757,8 +758,9 @@ class ApplicationCommand extends Base {
type: ApplicationCommandOptionTypes[subCommand.options[i].type],
name: subCommand.options[i].name,
value:
choice?.value || value == undefined ? undefined :
(subCommand.options[i].type == 'ATTACHMENT'
choice?.value || value == undefined
? value
: subCommand.options[i].type == 'ATTACHMENT'
? await addDataFromAttachment(value)
: subCommand.options[i].type == 'INTEGER'
? Number(value)
@ -771,7 +773,7 @@ class ApplicationCommand extends Base {
subCommand.options[i].name,
value,
)
: value),
: value,
};
optionFormat.push(data);
}

View File

@ -222,8 +222,7 @@ class ClientUser extends User {
* @returns {Promise}
*/
setDiscriminator(discriminator, password) {
if (this.nitroType == 'NONE')
throw new Error('You must be a Nitro User to change your discriminator.');
if (this.nitroType == 'NONE') throw new Error('You must be a Nitro User to change your discriminator.');
if (!password && !this.client.password) {
throw new Error('A password is required to change a discriminator.');
}

View File

@ -8,7 +8,7 @@ const getUUID = () =>
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, a => (a ^ ((Math.random() * 16) >> (a / 4))).toString(16));
// Function check url valid (ok copilot)
// eslint-disable-next-line
const checkUrl = url=> /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/.test(url);
const checkUrl = url => /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/.test(url);
class CustomStatus {
/**

File diff suppressed because it is too large Load Diff