LukeChannings / deno-arm64

ARM64 builds for Deno
312 stars 23 forks source link

Issues running Discord bot through denon #14

Closed Trimble-tech closed 1 year ago

Trimble-tech commented 1 year ago

I am running deno-arm64 on an Raspberry Pi 4B, with standard denon v2.5.0 installed on it. I'm trying to run a script with deno + denon to act as a Discord bot, it is linked here: https://github.com/tardiwave/songlink-discord-bot .

I don't know where the problem lies but I'll file an issue in case others have issues too. I am filing an issue with the script maker too, but I figure here is a good place to start.

When loading this script, it cannot find compiler options experimentalDecorators, or isolatedModules. This makes other things not load/crash. I have the log/output here:

[*] [main] v2.5.0 [*] [daem] watching path(s): **/*.* [*] [daem] watching extensions: ts,tsx,js,jsx,json [!] [#0] startingdeno run --allow-read --allow-env --allow-write --allow-net --config tsconfig.json --unstable mod.ts mod.ts Unsupported compiler options in "file:///root/songlink-discord-bot-main/tsconfig.json". The following options were ignored: experimentalDecorators, isolatedModules A new release of Deno is available: 1.30.0 → 1.30.1 Rundeno upgradeto install it. Error: [401] The Authorization header was missing or invalid. at Object.processQueue (https://deno.land/x/discordeno@11.2.0/src/rest/process_queue.ts:101:40) at async Object.processRequest (https://deno.land/x/discordeno@11.2.0/src/rest/process_request.ts:31:5) error: Uncaught (in promise) Error: Location: Error.captureStackTrace(errorStack); ^ at Object.runMethod (https://deno.land/x/discordeno@11.2.0/src/rest/run_method.ts:36:9) at getGatewayBot (https://deno.land/x/discordeno@11.2.0/src/helpers/misc/get_gateway_bot.ts:7:21) at startBot (https://deno.land/x/discordeno@11.2.0/src/bot.ts:33:29) at file:///root/songlink-discord-bot-main/mod.ts:82:1 [E] [daem] app crashed - waiting for file changes before starting ...

dbushell commented 1 year ago

The error you're getting is Error: [401] The Authorization header was missing or invalid.

This is a HTTP error. I'd guess the bot script is failing to authenticate with Discord, and it's not handling the error case. Possibly you're missing the TOKEN env variable that script requires? The script author would have to help you further.

Those TypeScript compiler options are ignored by Deno and not causing the error you're seeing. https://github.com/denoland/deno/issues/15968 https://deno.land/manual/typescript/configuration

Trimble-tech commented 1 year ago

Okay, good to know. I will take this info to the script author and see what can be done.