diff --git a/README.md b/README.md index 90d7829..3b7a52f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Logogram Discord Bot - A FFXIV Eureka Utility Bot | V1.1.0 - 2025/09/04 +# Logogram Discord Bot - A FFXIV Eureka Utility Bot | V1.1.1 - 2025/09/13 A Discord bot for Eureka Logos Actions and their recipes. ## Commands diff --git a/config.example.ts b/config.example.ts index bd74298..c170496 100755 --- a/config.example.ts +++ b/config.example.ts @@ -1,6 +1,6 @@ export const config = { 'name': 'Logogram Bot', // Name of the bot - 'version': '1.1.0', // Version of the bot + 'version': '1.1.1', // Version of the bot 'token': 'the_bot_token', // Discord API Token for this bot 'localToken': 'local_testing_token', // Discord API Token for a secondary OPTIONAL testing bot, THIS MUST BE DIFFERENT FROM "token" 'prefix': 'l!', // Prefix for all commands diff --git a/mod.ts b/mod.ts index 31ce370..1b035cd 100755 --- a/mod.ts +++ b/mod.ts @@ -109,17 +109,20 @@ startBot({ page: 1, }; + const classPrefixes = ['-class=', 'class=', '-c=', 'c=']; + const pagePrefixes = ['-page=', 'page=', '-p=', 'p=']; + args.forEach((arg) => { - if (arg.toLowerCase().startsWith('-class=')) { + if (classPrefixes.some(pfx => arg.toLowerCase().startsWith(pfx))) { // params.rawClass = arg.split('=')[1]; params.class = classToType(params.rawClass); params.isNin = params.rawClass.toLowerCase() === 'nin'; - } else if (arg.toLowerCase().startsWith('-page=')) { + } else if (pagePrefixes.some(pfx => arg.toLowerCase().startsWith(pfx))) { params.page = parseInt(arg.split('=')[1]); } }); - const cleanArgs = args.filter((arg) => !(arg.toLowerCase().startsWith('-class=') || arg.toLowerCase().startsWith('-page='))); + const cleanArgs = args.filter((arg) => !(classPrefixes.concat(pagePrefixes).some(pfx => arg.toLowerCase().startsWith(pfx)))); const rawQuery = cleanArgs.join(' '); const query = rawQuery.toLowerCase(); diff --git a/src/data.ts b/src/data.ts index 275027e..eb2dc25 100644 --- a/src/data.ts +++ b/src/data.ts @@ -745,6 +745,13 @@ const Actions: Array = [ }, ]; +// add dps flag at runtime +Actions.forEach(action => { + if (action.jobs.includes('melee') || action.jobs.includes('ranged') || action.jobs.includes('magic')) { + action.jobs.push('dps'); + } +}); + const ActionNames = Actions.map((action) => action.name.toLowerCase()); const Presets: Map> = new Map([ diff --git a/src/utils.ts b/src/utils.ts index 4e8770a..2f70fec 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,7 @@ export const classToType = (classAbr: string) => { switch (classAbr.toLowerCase()) { + case 'dps': + return 'dps'; case 'tank': case 'pld': case 'war':