Skip to content

Commit

Permalink
Merge pull request #11 from Turizak/genericCommand
Browse files Browse the repository at this point in the history
-m
  • Loading branch information
rakazirut authored Aug 24, 2024
2 parents e4936f7 + bb043d2 commit adb085e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 86 deletions.
3 changes: 2 additions & 1 deletion commands/trello/functions/createCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ const { colorInfo } = require("../data/colorInfo");
const { toTitleCase } = require("../../../utils/toTitleCase");
const { logger } = require("../../../utils/logger");

const createCard = async (interaction, board) => {
const createCard = async (interaction) => {
const fetch = (await import("node-fetch")).default;

const board = interaction.options.getString("board");
const type = interaction.options.getString("type");
const title = interaction.options.getString("title");
const description = interaction.options.getString("description");
Expand Down
41 changes: 0 additions & 41 deletions commands/trello/hivemindCard.js

This file was deleted.

41 changes: 0 additions & 41 deletions commands/trello/mtgCard.js

This file was deleted.

17 changes: 14 additions & 3 deletions commands/trello/dndCard.js → commands/trello/trelloCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,19 @@ const { createCard } = require("./functions/createCard");

module.exports = {
data: new SlashCommandBuilder()
.setName("dndcard")
.setDescription("Creates Trello card in DnD board")
.setName("trellocard")
.setDescription("Creates Trello card in selected board")
.addStringOption((option) =>
option
.setName("board")
.setDescription("Select project board")
.setRequired(true)
.addChoices(
{ name: "DnD", value: "dnd" },
{ name: "Hivemind", value: "hivemind" },
{ name: "MTG", value: "mtg" }
)
)
.addStringOption((option) =>
option
.setName("type")
Expand Down Expand Up @@ -36,6 +47,6 @@ module.exports = {
),

async execute(interaction) {
await createCard(interaction, "dnd");
await createCard(interaction);
},
};

0 comments on commit adb085e

Please sign in to comment.