From 40db69b88658120d53c65d6dd4e869fff1f818f4 Mon Sep 17 00:00:00 2001 From: Moritz Date: Sat, 20 Jan 2024 19:21:52 +0100 Subject: [PATCH] events api to v2 --- package.json | 2 +- src/services/vatsimEventsService.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7a793e3..abd7419 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord-bot", - "version": "1.4.0", + "version": "1.4.1", "scripts": { "run": "tsc && node ./dist/src/index.js", "commands:update": "rimraf ./dist && tsc && node ./dist/scripts/registerCommands.js", diff --git a/src/services/vatsimEventsService.ts b/src/services/vatsimEventsService.ts index 172b2ec..f8d2e48 100644 --- a/src/services/vatsimEventsService.ts +++ b/src/services/vatsimEventsService.ts @@ -4,10 +4,10 @@ import dayjs from 'dayjs'; async function getAllVatsimEvents(): Promise { try { - const vatsimEvents = await axios.get('https://my.vatsim.net/api/v1/events/all'); + const vatsimEvents = await axios.get('https://my.vatsim.net/api/v2/events/latest'); return vatsimEvents.data.data; } catch (error) { - throw new Error('Error on retrieving VATSIM Events'); + throw new Error(`Error on retrieving VATSIM Events: ${error}`); } }