diff --git a/bot/interactions/commands/create/raid.ts b/bot/interactions/commands/create/raid.ts index 03de557..5591099 100644 --- a/bot/interactions/commands/create/raid.ts +++ b/bot/interactions/commands/create/raid.ts @@ -60,6 +60,7 @@ export const createRaidCommand = async ( const isFivePerson = isFivePersonDungeon(title); const requestedDate = convertToDiscordDate(dateTime); + logger.log("info", "create attributes", {isFivePerson, requestedDate, dateTime}); const partyOptionsToMap = { Standard: { DPS: 6, HEALS: 2, TANKS: 2, WAITLIST: 3 }, Solo_tank: { DPS: 7, HEALS: 2, TANKS: 1, WAITLIST: 3 }, diff --git a/bot/interactions/commands/request/inviteLink.ts b/bot/interactions/commands/request/inviteLink.ts index 7c2a99f..5275067 100644 --- a/bot/interactions/commands/request/inviteLink.ts +++ b/bot/interactions/commands/request/inviteLink.ts @@ -1,4 +1,4 @@ -import dayjs from "dayjs"; +import dayjs from "dayjs-parser/dayjs"; import { APIChatInputApplicationCommandInteractionData, APIApplicationCommandInteractionDataRoleOption, diff --git a/bot/interactions/messageComponents/utils/date/dateToDiscordTimeStamp.ts b/bot/interactions/messageComponents/utils/date/dateToDiscordTimeStamp.ts index 335e243..7e0f70c 100644 --- a/bot/interactions/messageComponents/utils/date/dateToDiscordTimeStamp.ts +++ b/bot/interactions/messageComponents/utils/date/dateToDiscordTimeStamp.ts @@ -1,4 +1,7 @@ -import dayjs from "dayjs-parser/dayjs"; +import dayjs from "dayjs"; +import dayjsParser from "dayjs-parser"; + +dayjs.extend(dayjsParser); export const convertToDiscordDate = (date: string, { long = true, relative = false } = {}) => { const dateConvertible = dayjs(date).unix(); diff --git a/bot/interactions/messageComponents/utils/date/tests/dateToDiscordTimeStamp.spec.ts b/bot/interactions/messageComponents/utils/date/tests/dateToDiscordTimeStamp.spec.ts index 9b14e68..7e13b38 100644 --- a/bot/interactions/messageComponents/utils/date/tests/dateToDiscordTimeStamp.spec.ts +++ b/bot/interactions/messageComponents/utils/date/tests/dateToDiscordTimeStamp.spec.ts @@ -19,7 +19,7 @@ describe("User Actions - executeEmbedFieldActions", () => { vi.resetModules(); }); - test("Should provide a proper discord long timestamp", () => { + test.only("Should provide a proper discord long timestamp", () => { const dateResult = convertToDiscordDate('2022-09-25T11:31:00+05:30'); expect(dateResult).toBe(``); }); diff --git a/bot/interactions/messageComponents/utils/helper/tests/raid.spec.ts b/bot/interactions/messageComponents/utils/helper/tests/raid.spec.ts index ad5a8a3..ecbe775 100644 --- a/bot/interactions/messageComponents/utils/helper/tests/raid.spec.ts +++ b/bot/interactions/messageComponents/utils/helper/tests/raid.spec.ts @@ -83,6 +83,34 @@ describe.only("Raid - determineRaidTemplateType", () => { { name: "Wizard(DPS)", value: `<@randomnameone>`, inline: true }, ], }); - expect(result).toEqual({}); + expect(result).toEqual({ + templateId: "1U2U0U0U0U0U0U0", + templateMetaInfo: { + [Category.DPS_TITLE]: { + count: 1, + }, + [Category.DPS]: { + count: 2, + }, + [Category.HEALER_TITLE]: { + count: 0, + }, + [Category.HEALER]: { + count: 0, + }, + [Category.TANK_TITLE]: { + count: 0, + }, + [Category.TANK]: { + count: 0, + }, + [Category.WAITLIST_TITLE]: { + count: 0, + }, + [Category.WAITLIST]: { + count: 0, + }, + }, + }); }); });