diff --git a/app/index.ts b/app/index.ts index e46a79e..c911d60 100644 --- a/app/index.ts +++ b/app/index.ts @@ -8,7 +8,7 @@ async function main() { const YYMMDD = tomorrow.toISOString().slice(0, 10).replace(/-/g, "").toString(); // const YYMMDD = "20250306"; const weekday = tomorrow.getDay() === 0 ? 6 : tomorrow.getDay() - 1; - // const weekday = 4; + // const weekday = 2; console.log("πŸ“… | date:", YYMMDD); console.log("πŸ“… | weekday:", weekday); @@ -17,7 +17,7 @@ async function main() { schoolId: 41896, grade: 1, classNum: 1, - weekday: Weekday.Friday, + weekday: weekday, WEBHOOK_URL: process.env.DISCORD_WEBHOOK_SUNRIN_URL as string }) await Meal({ diff --git a/app/lib/comcigan.ts b/app/lib/comcigan.ts index a7d81df..507e2e4 100644 --- a/app/lib/comcigan.ts +++ b/app/lib/comcigan.ts @@ -2,6 +2,14 @@ import Comcigan, { School, Weekday } from '@imnyang/comcigan.ts' const comcigan = new Comcigan() -export default async function getTimetable({ schoolId, grade, classNum, weekday }: { schoolId: number, grade: number, classNum: number, weekday: number }) { +export async function getTimetable({ schoolId, grade, classNum, weekday }: { schoolId: number, grade: number, classNum: number, weekday: number }) { return await comcigan.getTimetable(schoolId, grade, classNum, weekday, false) } + +export const room = { + "프밍": "332ν˜Έμ‹€", + "컴ꡬ": "333ν˜Έμ‹€", + "체윑": "μš΄λ™μž₯", + "정톡": "411ν˜Έμ‹€", + "μŒμ•…": "μŒμ•…μ‹€" +} \ No newline at end of file diff --git a/app/lib/discord.ts b/app/lib/discord.ts index ffc087c..28f153f 100644 --- a/app/lib/discord.ts +++ b/app/lib/discord.ts @@ -1,4 +1,4 @@ -import getTimetable from "./comcigan"; +import { getTimetable, room } from "./comcigan"; import { getMealInfo, NameToEmoji, removeNutritionInfo } from "./meal"; export async function Meal({ MLSV_YMD, ATPT_OFCDC_SC_CODE, SD_SCHUL_CODE, username, schoolName, WEBHOOK_URL }: { MLSV_YMD: string, ATPT_OFCDC_SC_CODE: string, SD_SCHUL_CODE: string, username: string, schoolName: string, WEBHOOK_URL: string }) { @@ -50,7 +50,7 @@ export async function Timetable({ schoolId, grade, classNum, weekday, WEBHOOK_UR title: `🏫 | 학ꡐ : 선린인터넷고등학ꡐ`, fields: (timetableInfo ?? []).map((item) => ({ name: `${item.subject}${item.changed ? (" *") : ""}`, - value: item.teacher, + value: `${item.teacher}${item.subject in room ? ` | ${room[item.subject as keyof typeof room]}` : ""}`, inline: false, })), footer: {