Skip to content

Commit

Permalink
add f64 TDL to /todo
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Nov 3, 2023
1 parent 2bd0a46 commit 67d3073
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
15 changes: 7 additions & 8 deletions src/commands/faithful/guidelines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export const command: SlashCommand = {
.setRequired(false),
),
async execute(interaction: ChatInputCommandInteraction) {
let contents: string;
let keyword = interaction.options.getString("choice");
let content: string;
const keyword = interaction.options.getString("choice")?.toLocaleLowerCase();
const pack = interaction.options.getString("pack");
const errorEmbed = new EmbedBuilder()
.setTitle("Invalid choice!")
Expand All @@ -38,18 +38,17 @@ export const command: SlashCommand = {

switch (pack) {
case "faithful_32x":
contents = "https://docs.faithfulpack.net/pages/textures/f32-texturing-guidelines";
content = "https://docs.faithfulpack.net/pages/textures/f32-texturing-guidelines";
break;
case "faithful_64x":
contents = "https://docs.faithfulpack.net/pages/textures/f64-texturing-guidelines";
content = "https://docs.faithfulpack.net/pages/textures/f64-texturing-guidelines";
break;
case "classic_faithful_32x":
contents = "https://docs.faithfulpack.net/pages/textures/cf32-texturing-guidelines";
content = "https://docs.faithfulpack.net/pages/textures/cf32-texturing-guidelines";
break;
}

if (keyword) {
keyword = keyword.toLocaleLowerCase(); // remove case sensitivity for easier parsing
if (
!guidelineJSON
.map((i) => i.keywords)
Expand All @@ -66,12 +65,12 @@ export const command: SlashCommand = {
// if you pick an option that isn't present in the pack you selected
return interaction.reply({ embeds: [errorEmbed], ephemeral: true });
}
contents += `#${choice[pack]}`; // adds the html id specified in the json
content += `#${choice[pack]}`; // adds the html id specified in the json
break;
}
}
interaction
.reply({ content: contents, fetchReply: true })
.reply({ content, fetchReply: true })
.then((message: Message) => message.deleteButton());
},
};
13 changes: 9 additions & 4 deletions src/commands/faithful/todo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,31 @@ export const command: SlashCommand = {
.setDescription("The to-do list you want to view")
.addChoices(
{ name: "Faithful 32x", value: "faithful_32x" },
{ name: "Faithful 64x", value: "faithful_64x" },
{ name: "Classic Faithful 32x Jappa", value: "classic_faithful_32x" },
)
.setRequired(true),
),
async execute(interaction: ChatInputCommandInteraction) {
let contents: string;
let content: string;
const pack = interaction.options.getString("pack", true);
switch (pack) {
case "faithful_32x":
contents =
content =
"https://docs.google.com/document/d/1OXGHKiYJej0qvNgZWfFuYauyL1OjpL31usgK4dwuIkI/";
break;
case "faithful_64x":
content =
"https://docs.google.com/document/d/1xZ611CaVXbJ7utwnXAdk25We8n3S_du0mFuZAlNVi1U/";
break;
case "classic_faithful_32x":
contents =
content =
"https://docs.google.com/document/d/1lw5EvJhVbubNPm3ZiOXAr8Aos9gCkmz-rh03uIMuqY0/";
break;
}

interaction
.reply({ content: contents, fetchReply: true })
.reply({ content, fetchReply: true })
.then((message: Message) => message.deleteButton());
},
};

0 comments on commit 67d3073

Please sign in to comment.