change preset shorthand to pr
This commit is contained in:
parent
548d2b8eb1
commit
774ab87966
|
@ -1,4 +1,4 @@
|
|||
# Logogram Discord Bot - A FFXIV Eureka Utility Bot | V1.2.0 - 2025/04/25
|
||||
# Logogram Discord Bot - A FFXIV Eureka Utility Bot | V1.2.1 - 2025/04/25
|
||||
A Discord bot for Eureka Logos Actions and their recipes.
|
||||
|
||||
## Commands
|
||||
|
@ -12,7 +12,7 @@ A Discord bot for Eureka Logos Actions and their recipes.
|
|||
- Examples: `-class=healer`, `-class=drg`
|
||||
- `-page=#`
|
||||
- Use to view more search results
|
||||
- `preset` or `p`
|
||||
- `preset` or `pr`
|
||||
- Shows a pre-made list of actions for convenient viewing
|
||||
- `flowchart` or `flow` or `f`
|
||||
- Shows a simple flowchart for best actions
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export const config = {
|
||||
name: 'Logogram Bot', // Name of the bot
|
||||
version: '1.2.0', // Version of the bot
|
||||
version: '1.2.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
|
||||
|
|
21
mod.ts
21
mod.ts
|
@ -158,7 +158,9 @@ startBot({
|
|||
});
|
||||
} else if (query && data.ActionShortNames.includes(query)) {
|
||||
log(LT.LOG, `in shorthand matched '${query}'`);
|
||||
const searchResults: Array<number> = data.Actions.filter((action) => action.shorthand === query).map((action) => data.ActionNames.indexOf(action.name.toLowerCase()));
|
||||
const searchResults: Array<number> = data.Actions.filter((action) => action.shorthand === query).map((action) =>
|
||||
data.ActionNames.indexOf(action.name.toLowerCase())
|
||||
);
|
||||
message
|
||||
.send({
|
||||
content: searchResults.length > 1 ? `Showing ${searchResults.length} actions:` : 'Showing single action:',
|
||||
|
@ -169,7 +171,9 @@ startBot({
|
|||
});
|
||||
} else {
|
||||
log(LT.LOG, `in general search '${query}'`);
|
||||
const initialSearchResults: Array<number> = data.ActionNames.filter((action) => action.includes(query)).map((action) => data.ActionNames.indexOf(action));
|
||||
const initialSearchResults: Array<number> = data.ActionNames.filter((action) => action.includes(query)).map((action) =>
|
||||
data.ActionNames.indexOf(action)
|
||||
);
|
||||
const searchResults: Array<number> = initialSearchResults.filter((actionIdx) =>
|
||||
params.class
|
||||
? (data.Actions[actionIdx].jobs.includes('all-nin') && !params.isNin) ||
|
||||
|
@ -185,7 +189,8 @@ startBot({
|
|||
}
|
||||
const classMessage = params.class ? ` -class=${params.rawClass}` : '';
|
||||
const userQuery = `${rawQuery}${classMessage}`.trim();
|
||||
const paginationMessage = searchResults.length > config.resultsPerPage
|
||||
const paginationMessage =
|
||||
searchResults.length > config.resultsPerPage
|
||||
? `\nShowing page ${params.page} of ${totalPages}\n\nTo see more results, please run \`${config.prefix}logos ${userQuery} -page=#\`, where # is the page number you wish to see.`
|
||||
: '';
|
||||
message
|
||||
|
@ -207,8 +212,8 @@ startBot({
|
|||
}
|
||||
}
|
||||
}
|
||||
} else if (command === 'preset' || command === 'p') {
|
||||
// l!preset or l!p
|
||||
} else if (command === 'preset' || command === 'pr') {
|
||||
// l!preset or l!pr
|
||||
// Returns logos actions stuff
|
||||
const rawQuery = args.join(' ');
|
||||
const query = rawQuery.toLowerCase();
|
||||
|
@ -226,12 +231,10 @@ startBot({
|
|||
} else if (!query) {
|
||||
message
|
||||
.send({
|
||||
content: `Available presets: ${
|
||||
data.Presets.keys()
|
||||
content: `Available presets: ${data.Presets.keys()
|
||||
.toArray()
|
||||
.map((p) => `\`${p}\``)
|
||||
.join(', ')
|
||||
}`,
|
||||
.join(', ')}`,
|
||||
})
|
||||
.catch((e) => {
|
||||
log(LT.ERROR, `Failed to send message: ${JSON.stringify(message)} | ${JSON.stringify(e)}`);
|
||||
|
|
|
@ -4,7 +4,8 @@ const errorColor = 0xe71212;
|
|||
|
||||
export const constantCmds = {
|
||||
help: {
|
||||
embeds: [{
|
||||
embeds: [
|
||||
{
|
||||
title: `${config.name}'s Available Commands:`,
|
||||
fields: [
|
||||
{
|
||||
|
@ -24,11 +25,12 @@ export const constantCmds = {
|
|||
},
|
||||
{
|
||||
name: `\`${config.prefix}logograms [query]\` or \`${config.prefix}l [query]\``,
|
||||
value: 'Sends information about the requested logogram, or logograms matching the query\nCan use `-class=abbr` to further filter the results, or `-page=#` to view more results',
|
||||
value:
|
||||
'Sends information about the requested logogram, or logograms matching the query\nCan use `-class=abbr` to further filter the results, or `-page=#` to view more results',
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
name: `\`${config.prefix}preset [query]\` or \`${config.prefix}p [query]\``,
|
||||
name: `\`${config.prefix}preset [query]\` or \`${config.prefix}pr [query]\``,
|
||||
value: 'Sends information about the requested preset list',
|
||||
inline: true,
|
||||
},
|
||||
|
@ -38,27 +40,36 @@ export const constantCmds = {
|
|||
inline: true,
|
||||
},
|
||||
],
|
||||
}],
|
||||
},
|
||||
],
|
||||
},
|
||||
info: {
|
||||
embeds: [{
|
||||
fields: [{
|
||||
embeds: [
|
||||
{
|
||||
fields: [
|
||||
{
|
||||
name: `${config.name}, a Discord bot for Eureka Logogram Actions.`,
|
||||
value: `${config.name} is developed by Ean AKA Burn_E99.\n\nFINAL FANTASY XIV SQUARE ENIX CO., LTD. FINAL FANTASY is a registered trademark of Square Enix Holdings Co., Ltd. All material used under license.`,
|
||||
}],
|
||||
}],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
version: {
|
||||
embeds: [{
|
||||
embeds: [
|
||||
{
|
||||
title: `My current version is ${config.version}`,
|
||||
}],
|
||||
},
|
||||
],
|
||||
},
|
||||
logogramsNoQuery: {
|
||||
embeds: [{
|
||||
embeds: [
|
||||
{
|
||||
color: errorColor,
|
||||
title: 'No query provided!',
|
||||
description: `Please type something after the command, such as \`${config.prefix}logos wisdom\`.`,
|
||||
}],
|
||||
},
|
||||
],
|
||||
},
|
||||
flowchart: 'https://ffxiv.eanm.dev/eureka/Simple-Logos-Flowchart.png',
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue