Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
devadathanmb committed Aug 18, 2024
1 parent d41fc70 commit cc675ff
Show file tree
Hide file tree
Showing 15 changed files with 335 additions and 264 deletions.
27 changes: 27 additions & 0 deletions src/constants/api/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const ORIGIN_URL = "https://ktu.edu.in/";
const BASE_URL = "https://api.ktu.edu.in";
const COURSES_URL = "https://api.ktu.edu.in/ktu-web-service/anon/masterData";
const PUBLISHED_RESULTS_URL =
"https://api.ktu.edu.in/ktu-web-service/anon/result";
const RESULT_URL =
"https://api.ktu.edu.in/ktu-web-service/anon/individualresult";
const ANOUNCEMENTS_URL =
"https://api.ktu.edu.in/ktu-web-portal-api/anon/announcemnts";
const ATTACHMENT_URL =
"https://api.ktu.edu.in/ktu-web-portal-api/anon/getAttachment";
const ACADEMIC_CALENDAR_URL =
"https://api.ktu.edu.in/ktu-web-portal-api/anon/academicCalendar";
const TIMETABLE_URL =
"https://api.ktu.edu.in/ktu-web-portal-api/anon/timetable";

export {
ORIGIN_URL,
BASE_URL,
COURSES_URL,
PUBLISHED_RESULTS_URL,
RESULT_URL,
ANOUNCEMENTS_URL,
ATTACHMENT_URL,
ACADEMIC_CALENDAR_URL,
TIMETABLE_URL,
};
6 changes: 6 additions & 0 deletions src/constants/bot/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Contains links, constants specific to bot
const GITHUB_REPO = "";
const BOT_IMAGE = "";
const UPTIME_ROBOT_URL = "";

export { GITHUB_REPO, BOT_IMAGE };
38 changes: 0 additions & 38 deletions src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,42 +44,6 @@ const FILTERS_REGEX: Record<string, Array<string>> = {
"mhm",
],
};

const FILTERS: Record<string, string> = {
all: "ALL NOTIFICATIONS",
relevant: "ALL RELEVANT NOTIFS",
btech: "B.Tech",
mtech: "M.Tech",
mca: "MCA",
phd: "PhD",
bdes: "B.Des",
mba: "MBA",
barch: "B.Arch",
march: "M.Arch",
bvoc: "B.Voc",
mplan: "M.Plan",
hmct: "Hotel Management & Catering Technology",
mhm: "MHM",
};

const COURSES: Record<string, string> = {
btech: "B.Tech",
mtech: "M.Tech",
mcaTwoYear: "MCA (2 Year)",
mcaSecondYearDirect: "MCA (Second Year Direct)",
mcaIntegrated: "MCA Dual degree (INTEGRATED)",
mca: "MCA",
phd: "PhD",
bdes: "B.Des",
mba: "MBA",
barch: "B.Arch",
march: "M.Arch",
bvoc: "B.Voc",
mplan: "M.Plan",
hmct: "Hotel Management & Catering Technology",
mhm: "MHM",
};

export {
COURSES_URL,
PUBLISHED_RESULTS_URL,
Expand All @@ -89,8 +53,6 @@ export {
ACADEMIC_CALENDAR_URL,
TIMETABLE_URL,
FILTERS_REGEX,
FILTERS,
COURSES,
BASE_URL,
ORIGIN_URL,
};
36 changes: 36 additions & 0 deletions src/constants/courses/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const FILTERS: Record<string, string> = {
all: "ALL NOTIFICATIONS",
relevant: "ALL RELEVANT NOTIFS",
btech: "B.Tech",
mtech: "M.Tech",
mca: "MCA",
phd: "PhD",
bdes: "B.Des",
mba: "MBA",
barch: "B.Arch",
march: "M.Arch",
bvoc: "B.Voc",
mplan: "M.Plan",
hmct: "Hotel Management & Catering Technology",
mhm: "MHM",
};

const COURSES: Record<string, string> = {
btech: "B.Tech",
mtech: "M.Tech",
mcaTwoYear: "MCA (2 Year)",
mcaSecondYearDirect: "MCA (Second Year Direct)",
mcaIntegrated: "MCA Dual degree (INTEGRATED)",
mca: "MCA",
phd: "PhD",
bdes: "B.Des",
mba: "MBA",
barch: "B.Arch",
march: "M.Arch",
bvoc: "B.Voc",
mplan: "M.Plan",
hmct: "Hotel Management & Catering Technology",
mhm: "MHM",
};

export { FILTERS, COURSES };
7 changes: 7 additions & 0 deletions src/handlers/defaultHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ async function defaultHandler(ctx: CustomContext) {
"CAACAgUAAxUAAWWo82rpI38WV0jq6qMAARi8ukCQsQAC5QEAAuG8kQTvnIzSTjMkFjQE",
"CAACAgUAAxkBAAIkDGWo83NnPOrKvL8aFzpayI_6I1_TAALjAQAC4byRBMnaRVi-I79aNAQ",
"CAACAgUAAxkBAAIkG2Wo8_GT5h5BvRaBtywQWhpPkIuNAAI7BAACIlhAVVgi-y9wL25NNAQ",
"CAACAgQAAxUAAWbBus1zt0-TVwMbUwW-GMuL69npAAJBAQACqCEhBq9mxhtt7kuLNQQ",
"CAACAgEAAxUAAWbBusxvVGb7YdOAlTMByXwHVyE8AAJNAQACf63JRqKC0Oe6Dr3nNQQ",
"CAACAgEAAxUAAWbBusyMIZeROvzDamPcJdOJfW_rAALmDwACWBTJRv3vDkn03B_vNQQ",
"CAACAgUAAxUAAWbBusyW0NuhOQ7BzKqgoX_t7UxGAAJCBAAC_AFhVEFmD3JxIQ-TNQQ",
"CAACAgUAAxUAAWbBusyc-Ry3unufmuS5y7oEffI9AAI_EAAChuNBVgpa4tSyQV8dNQQ",
"CAACAgUAAxUAAWbBvLnW041UZREYUp_GYlD7jQpHAAKeBgACktpJVFO_74Mi1elVNQQ",
"CAACAgUAAxkBAAJxlGbBvLsItyXAg2OGko_t2af6rYgMAAIlBQACkolJVOQXgOpOuPz-NQQ",
];

const randomSticker = stickers[Math.floor(Math.random() * stickers.length)];
Expand Down
2 changes: 1 addition & 1 deletion src/services/fetchAcademicCalendars.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { axios } from "api/axios";
import { ACADEMIC_CALENDAR_URL } from "constants/constants";
import { ACADEMIC_CALENDAR_URL } from "constants/api/constants";
import { AcademicCalendar } from "types/types";
import ServerError from "errors/ServerError";
import formatDate from "utils/formatDate";
Expand Down
2 changes: 1 addition & 1 deletion src/services/fetchAnnouncements.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { axios } from "api/axios";
import { ANOUNCEMENTS_URL } from "constants/constants";
import { ANOUNCEMENTS_URL } from "constants/api/constants";
import { Announcement } from "types/types";
import ServerError from "errors/ServerError";
import { stripHtml } from "string-strip-html";
Expand Down
2 changes: 1 addition & 1 deletion src/services/fetchAttachment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { axios } from "api/axios";
import { ATTACHMENT_URL } from "constants/constants";
import { ATTACHMENT_URL } from "constants/api/constants";
import ServerError from "errors/ServerError";
import Logger from "@/utils/logger";

Expand Down
2 changes: 1 addition & 1 deletion src/services/fetchCourses.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { axios } from "api/axios";
import { COURSES_URL } from "constants/constants";
import { COURSES_URL } from "constants/api/constants";
import { Course } from "types/types";
import ServerError from "errors/ServerError";
import Logger from "@/utils/logger";
Expand Down
2 changes: 1 addition & 1 deletion src/services/fetchPublishedResults.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { axios } from "api/axios";
import { PUBLISHED_RESULTS_URL } from "constants/constants";
import { PUBLISHED_RESULTS_URL } from "constants/api/constants";
import { PublishedResultData } from "types/types";
import ServerError from "errors/ServerError";
import DataNotFoundError from "errors/DataNotFoundError";
Expand Down
2 changes: 1 addition & 1 deletion src/services/fetchResult.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { axios } from "api/axios";
import { RESULT_URL } from "constants/constants";
import { RESULT_URL } from "constants/api/constants";
import InvalidDataError from "errors/InvalidDataError";
import { ResultDetails, ResultSummary } from "types/types";
import ServerError from "errors/ServerError";
Expand Down
2 changes: 1 addition & 1 deletion src/services/fetchTimetables.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { axios } from "api/axios";
import { TIMETABLE_URL } from "constants/constants";
import { TIMETABLE_URL } from "constants/api/constants";
import { Timetable } from "types/types";
import ServerError from "errors/ServerError";
import formatDate from "utils/formatDate";
Expand Down
Loading

0 comments on commit cc675ff

Please sign in to comment.