mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Fix all eslint v9 issues
This commit is contained in:
@@ -27,7 +27,6 @@ module.exports = class AlertCommand extends Command {
|
||||
name: 'The Hill',
|
||||
url: 'https://thehill.com/',
|
||||
reason: 'Image',
|
||||
// eslint-disable-next-line max-len
|
||||
reasonURL: 'https://thehill.com/policy/technology/409737-this-is-a-test-us-officials-test-presidential-alert'
|
||||
}
|
||||
],
|
||||
|
||||
@@ -32,7 +32,6 @@ module.exports = class ChiIdeaCommand extends Command {
|
||||
name: 'Inside Scanlation',
|
||||
url: 'https://www.insidescanlation.com/',
|
||||
reason: 'Wild Words Font',
|
||||
// eslint-disable-next-line max-len
|
||||
reasonURL: 'https://www.insidescanlation.com/etc/the-idiots-guide-to-editing-manga/guide/type/fonts.html'
|
||||
}
|
||||
],
|
||||
|
||||
@@ -21,7 +21,6 @@ module.exports = class RawCommand extends Command {
|
||||
name: 'Inside Scanlation',
|
||||
url: 'https://www.insidescanlation.com/',
|
||||
reason: 'Wild Words Font',
|
||||
// eslint-disable-next-line max-len
|
||||
reasonURL: 'https://www.insidescanlation.com/etc/the-idiots-guide-to-editing-manga/guide/type/fonts.html'
|
||||
}
|
||||
],
|
||||
|
||||
@@ -158,7 +158,7 @@ module.exports = class ChessCommand extends Command {
|
||||
if (alreadySaved) {
|
||||
await msg.say('You already have a saved game, do you want to overwrite it?');
|
||||
const verification = await verify(msg.channel, author);
|
||||
if (!verification) continue; // eslint-disable-line max-depth
|
||||
if (!verification) continue;
|
||||
}
|
||||
if (gameState.turn === 'black') blackTime -= new Date() - now;
|
||||
if (gameState.turn === 'white') whiteTime -= new Date() - now;
|
||||
|
||||
@@ -109,7 +109,7 @@ module.exports = class NimCommand extends Command {
|
||||
time: 60000
|
||||
});
|
||||
if (!rowTurn.size) {
|
||||
if (lastTurnTimeout) { // eslint-disable-line max-depth
|
||||
if (lastTurnTimeout) {
|
||||
winner = 'time';
|
||||
break;
|
||||
} else {
|
||||
|
||||
@@ -72,7 +72,7 @@ module.exports = class HangmanCommand extends Command {
|
||||
} else if (word.includes(choice)) {
|
||||
displayText = true;
|
||||
for (let i = 0; i < word.length; i++) {
|
||||
if (word.charAt(i) !== choice) continue; // eslint-disable-line max-depth
|
||||
if (word.charAt(i) !== choice) continue;
|
||||
confirmation.push(word.charAt(i));
|
||||
display[i] = word.charAt(i);
|
||||
}
|
||||
@@ -112,7 +112,7 @@ module.exports = class HangmanCommand extends Command {
|
||||
partOfSpeech: data.fl,
|
||||
definiton: data.shortdef.map((definition, i) => `(${i + 1}) ${definition}`).join('\n')
|
||||
};
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ module.exports = class HorseRaceCommand extends Command {
|
||||
name: 'Ambition',
|
||||
url: 'https://ambition.com/',
|
||||
reason: 'Image',
|
||||
// eslint-disable-next-line max-len
|
||||
reasonURL: 'https://help.ambition.com/hc/en-us/articles/360005048011-How-do-I-set-up-a-Leaderboard-Slide-'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -37,7 +37,6 @@ module.exports = class WhosThatPokemonCryCommand extends Command {
|
||||
name: 'u/CaptainRako',
|
||||
url: 'https://www.reddit.com/user/CaptainRako/',
|
||||
reason: 'Background Image',
|
||||
// eslint-disable-next-line max-len
|
||||
reasonURL: 'https://www.reddit.com/r/pokemon/comments/420xiv/whos_that_pokemon_1920x1080_hd_template_i_just/'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -44,7 +44,6 @@ module.exports = class WhosThatPokemonCommand extends Command {
|
||||
name: 'u/CaptainRako',
|
||||
url: 'https://www.reddit.com/user/CaptainRako/',
|
||||
reason: 'Background Image',
|
||||
// eslint-disable-next-line max-len
|
||||
reasonURL: 'https://www.reddit.com/r/pokemon/comments/420xiv/whos_that_pokemon_1920x1080_hd_template_i_just/'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ module.exports = class NameRaterCommand extends Command {
|
||||
const user = await this.client.users.fetch(matches[1]);
|
||||
if (!user) return false;
|
||||
return true;
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Credit: https://github.com/discordjs/Commando/blob/master/src/commands/util/eval.js
|
||||
const util = require('util');
|
||||
/* eslint-disable no-unused-vars, prefer-destructuring */
|
||||
/* eslint-disable no-unused-vars */
|
||||
const discord = require('discord.js');
|
||||
const Util = require('../../util/Util');
|
||||
/* eslint-enable no-unused-vars, prefer-destructuring */
|
||||
/* eslint-enable no-unused-vars */
|
||||
const tags = require('common-tags');
|
||||
const Command = require('../../framework/Command');
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = class MemberArgumentType extends ArgumentType {
|
||||
const member = await msg.guild.members.fetch(await this.client.users.fetch(matches[1]));
|
||||
if (!member) return false;
|
||||
return true;
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = class UserArgumentType extends ArgumentType {
|
||||
const user = await msg.client.users.fetch(matches[1]);
|
||||
if (!user) return false;
|
||||
return true;
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ module.exports = class Player {
|
||||
const extra = await this.chooseCards(black, chosenCards);
|
||||
if (!this.user.bot) await this.user.send(`Nice! Return to ${this.game.channel} to await the results!`);
|
||||
return extra;
|
||||
} catch (err) {
|
||||
} catch {
|
||||
this.strikes++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ module.exports = class Game {
|
||||
for (const user of list) {
|
||||
try {
|
||||
await user.send(`You are ${roles[i] === 'detective' ? 'the' : 'a part of the'} **${roles[i]}**.`);
|
||||
} catch (err) {
|
||||
} catch {
|
||||
await this.channel.send(
|
||||
`${user}, I couldn't send a DM to you. Please open your DMs and use the \`me\` command to see your role.`
|
||||
);
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
const Argument = require('../framework/ArgumentType');
|
||||
const codeblock = /```(?:(\S+)\n)?\s*([^]+?)\s*```/i;
|
||||
|
||||
module.exports = class CodeArgument extends Argument {
|
||||
constructor(client) {
|
||||
super(client, 'code');
|
||||
}
|
||||
|
||||
validate(value) {
|
||||
if (!value) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
async parse(value, msg) {
|
||||
if (!value) return null;
|
||||
if (/^[0-9]+$/.test(value)) {
|
||||
try {
|
||||
const message = await msg.channel.messages.fetch(value);
|
||||
value = message.content;
|
||||
} catch (err) {
|
||||
return { code: value, lang: null };
|
||||
}
|
||||
}
|
||||
if (codeblock.test(value)) {
|
||||
const parsed = codeblock.exec(value);
|
||||
return {
|
||||
code: parsed[2],
|
||||
lang: parsed[1] ? parsed[1].toLowerCase() : null
|
||||
};
|
||||
}
|
||||
return { code: value, lang: null };
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user