Archived
0
0
Fork 0

style: fomatted code

This commit is contained in:
Daryl Ronningen 2021-07-02 13:37:02 -05:00
parent bd995747fa
commit 523be3e439
Signed by: Daryl Ronningen
GPG key ID: FD23F0C934A5EC6B
8 changed files with 39 additions and 26 deletions

View file

@ -165,6 +165,15 @@
</rules> </rules>
</arrangement> </arrangement>
</codeStyleSettings> </codeStyleSettings>
<codeStyleSettings language="SQL">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
<option name="USE_TAB_CHARACTER" value="true" />
<option name="SMART_TABS" value="true" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript"> <codeStyleSettings language="TypeScript">
<option name="SPACE_BEFORE_IF_PARENTHESES" value="false" /> <option name="SPACE_BEFORE_IF_PARENTHESES" value="false" />
<option name="SPACE_BEFORE_WHILE_PARENTHESES" value="false" /> <option name="SPACE_BEFORE_WHILE_PARENTHESES" value="false" />

4
.idea/encodings.xml Normal file
View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8" />
</project>

View file

@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

View file

@ -1,5 +1,8 @@
<component name="InspectionProjectProfileManager"> <component name="InspectionProjectProfileManager">
<settings> <settings>
<option name="PROJECT_PROFILE" value="Default" />
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
<list size="7"> <list size="7">
<item index="0" class="java.lang.String" itemvalue="INFORMATION" /> <item index="0" class="java.lang.String" itemvalue="INFORMATION" />
<item index="1" class="java.lang.String" itemvalue="TYPO" /> <item index="1" class="java.lang.String" itemvalue="TYPO" />

View file

@ -50,7 +50,7 @@ export default class extends Command {
commandGroups.push({ commandGroups.push({
name: command.options.group!, name: command.options.group!,
embed: new MessageEmbed(), embed: new MessageEmbed(),
commands: [command], commands: [ command ],
}); });
categories.push(command.options.group!); categories.push(command.options.group!);
@ -96,8 +96,8 @@ export default class extends Command {
const helpMsg = await message.channel.send({ const helpMsg = await message.channel.send({
content: i18next.t('commands:help.helpScreenBtnHelp'), content: i18next.t('commands:help.helpScreenBtnHelp'),
embeds: [commandGroups[0]!.embed], embeds: [ commandGroups[0]!.embed ],
components: [[previousCategoryBtn, nextCategoryBtn], [chooseHelpCategory]], components: [ [ previousCategoryBtn, nextCategoryBtn ], [ chooseHelpCategory ] ],
}); });
const buttonCollector = helpMsg.channel.createMessageComponentInteractionCollector({ time: 60000 }); const buttonCollector = helpMsg.channel.createMessageComponentInteractionCollector({ time: 60000 });
@ -118,8 +118,8 @@ export default class extends Command {
await interaction.update({ await interaction.update({
content: i18next.t('commands:help.helpScreenBtnHelp'), content: i18next.t('commands:help.helpScreenBtnHelp'),
embeds: [commandGroups[currentPage]!.embed], embeds: [ commandGroups[currentPage]!.embed ],
components: [[previousCategoryBtn, nextCategoryBtn], [chooseHelpCategory]], components: [ [ previousCategoryBtn, nextCategoryBtn ], [ chooseHelpCategory ] ],
}); });
} else if(interaction.customID === 'previousCategoryBtn') { } else if(interaction.customID === 'previousCategoryBtn') {
currentPage--; currentPage--;
@ -136,8 +136,8 @@ export default class extends Command {
await interaction.update({ await interaction.update({
content: i18next.t('commands:help.helpScreenBtnHelp'), content: i18next.t('commands:help.helpScreenBtnHelp'),
embeds: [commandGroups[currentPage]!.embed], embeds: [ commandGroups[currentPage]!.embed ],
components: [[previousCategoryBtn, nextCategoryBtn], [chooseHelpCategory]], components: [ [ previousCategoryBtn, nextCategoryBtn ], [ chooseHelpCategory ] ],
}); });
} else if(interaction.customID === 'chooseHelpCategory') { } else if(interaction.customID === 'chooseHelpCategory') {
currentPage = categories.indexOf(interaction.values[0]); currentPage = categories.indexOf(interaction.values[0]);
@ -159,8 +159,8 @@ export default class extends Command {
await interaction.update({ await interaction.update({
content: i18next.t('commands:help.helpScreenBtnHelp'), content: i18next.t('commands:help.helpScreenBtnHelp'),
embeds: [commandGroups[currentPage]!.embed], embeds: [ commandGroups[currentPage]!.embed ],
components: [[previousCategoryBtn, nextCategoryBtn], [chooseHelpCategory]], components: [ [ previousCategoryBtn, nextCategoryBtn ], [ chooseHelpCategory ] ],
}); });
} }
}); });
@ -171,7 +171,7 @@ export default class extends Command {
await helpMsg.edit({ await helpMsg.edit({
content: i18next.t('commands:help.helpTimedOut'), content: i18next.t('commands:help.helpTimedOut'),
embeds: [commandGroups[currentPage]!.embed], embeds: [ commandGroups[currentPage]!.embed ],
components: [], components: [],
}); });
}); });
@ -192,7 +192,7 @@ export default class extends Command {
usage: findCommand.options.usage ? `!${findCommand.options.name} ${findCommand.options.usage}` : i18next.t('commands:generic.noUsage'), usage: findCommand.options.usage ? `!${findCommand.options.name} ${findCommand.options.usage}` : i18next.t('commands:generic.noUsage'),
})); }));
await message.channel.send({ embeds: [commandEmbed] }); await message.channel.send({ embeds: [ commandEmbed ] });
} else { } else {
await message.reply(i18next.t('commands:help.unknownCommand')); await message.reply(i18next.t('commands:help.unknownCommand'));
} }

View file

@ -29,7 +29,7 @@ export default class extends Command {
args: [ args: [
{ {
name: 'language', name: 'language',
acceptedValues: ['js', 'javascript', 'ts', 'typescript'], acceptedValues: [ 'js', 'javascript', 'ts', 'typescript' ],
description: i18next.t('commands:vm.languageArg'), description: i18next.t('commands:vm.languageArg'),
}, },
{ {

View file

@ -70,8 +70,8 @@ figlet('Argon Bot', (err, data) => {
}); });
const client = new ArgonClient({ const client = new ArgonClient({
intents: ['GUILDS', 'GUILD_MESSAGES', 'DIRECT_MESSAGES'], intents: [ 'GUILDS', 'GUILD_MESSAGES', 'DIRECT_MESSAGES' ],
partials: ['CHANNEL'], partials: [ 'CHANNEL' ],
}); });
client.on('message', async (msg) => { client.on('message', async (msg) => {
@ -122,7 +122,10 @@ client.on('message', async (msg) => {
if(now < expirationTime) { if(now < expirationTime) {
const timeLeft = (expirationTime - now) / 1000; const timeLeft = (expirationTime - now) / 1000;
await msg.reply(i18next.t('commands:errors.cooldownError', { time: timeLeft.toFixed(1), command: findCommand.options.name })); await msg.reply(i18next.t('commands:errors.cooldownError', {
time: timeLeft.toFixed(1),
command: findCommand.options.name,
}));
msg.channel.stopTyping(); msg.channel.stopTyping();
return; return;
} }
@ -148,14 +151,14 @@ client.on('ready', async () => {
info('Loading translations...', ELoggingScope.Startup); info('Loading translations...', ELoggingScope.Startup);
await i18next.use(Fluent).use(Backend).init({ await i18next.use(Fluent).use(Backend).init({
supportedLngs: ['en-US', 'owo'], supportedLngs: [ 'en-US', 'owo' ],
lng: 'en-US', lng: 'en-US',
fallbackLng: 'en-US', fallbackLng: 'en-US',
defaultNS: 'common', defaultNS: 'common',
fallbackNS: 'common', fallbackNS: 'common',
ns: ['common', 'commands'], ns: [ 'common', 'commands' ],
backend: { backend: {
backends: [FSBackend], backends: [ FSBackend ],
backendOptions: [ backendOptions: [
{ {
loadPath: `${process.cwd()}/translations/{{lng}}/{{ns}}.json`, loadPath: `${process.cwd()}/translations/{{lng}}/{{ns}}.json`,

View file

@ -19,7 +19,7 @@ export const Defaults = {
logLevel: 'info', logLevel: 'info',
}, },
configSchema: { configSchema: {
required: ['token', 'logLevel', 'prefix', 'owner', 'db'], required: [ 'token', 'logLevel', 'prefix', 'owner', 'db' ],
type: 'object', type: 'object',
properties: { properties: {
token: { token: {
@ -49,7 +49,7 @@ export const Defaults = {
db: { db: {
$id: '#/properties/db', $id: '#/properties/db',
type: 'object', type: 'object',
required: ['host', 'port', 'user', 'password', 'database'], required: [ 'host', 'port', 'user', 'password', 'database' ],
properties: { properties: {
host: { host: {
$id: '#/properties/db/host', $id: '#/properties/db/host',