mctantwerp / Canvas-Student-Announcement-Discord-Bot

A discord bot linked with the Canvas Student API that gives the possibility to watch specific courses and embed posts when there are new announcements for these courses.
Apache License 2.0
28 stars 9 forks source link

UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID] #14

Open Riftriot opened 2 years ago

Riftriot commented 2 years ago

UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID]: An invalid token was provided. at WebSocketManager.connect (F:\CanvasBotR\Canvas-Student-Announcement-Discord-Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:133:26) at Client.login (F:\CanvasBotR\Canvas-Student-Announcement-Discord-Bot\node_modules\discord.js\src\client\Client.js:223:21) (Use node --trace-warnings ... to show where the warning was created) (node:35832) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:35832) [DEP0018]

Riftriot commented 2 years ago

My .env file: DISCORD_TOKEN='< thetoken>' CANVAS_TOKEN='< theothertoken>'

CANVAS_API_COURSES_URL='https://URL.instructure.com/api/v1/courses?enrollment_state=active&access_token=' CANVAS_API_COURSE_URL='https://URL.instructure.com/api/v1/courses/[courseid]?access_token=' CANVAS_API_ANN_URL='https://URL.instructure.com/api/v1/announcements?context_codes[]=course_[courseid]&access_token='