Channel not found error when running without Firebase keys
See original GitHub issueI was trying to set up EddieBot
locally without the Firebase keys.
- I disabled the Firebase errors by commenting out these lines:
./node_modules/firebase-admin/lib/auth/credential.js:134
./node_modules/firebase-admin/lib/auth/credential.js:142
- Then I filled up
./.env
like this:
DISCORD_TOKEN=<token of my bot in single quotes>
COMMAND_PREFIX="^"
# You can find this from "right clicking" on your server and selecting "Copy ID".
DISCORD_SERVER_ID=<my server token in single quotes>
# You can use ANY channel by "right clicking" on your server and selecting "Copy ID". A #bot channel is recommended.
DISCORD_BOT_CHANNEL_ID=<token on the #bot channel in my server in single quotes>
# Generate a firebase service account in the UI, the `gcloud` CLI will generate you the wrong service account.
# When you download your Firebase service account details, these will be in the downloaded/generated json file.
FIREBASE_PRIVATE_KEY=""
FIREBASE_PROJECT_ID=""
FIREBASE_CLIENT_EMAIL=""
FIREBASE_DATABASE_URL=""
- Now when I try to run the bot, this is what I face:
❯ npm run start:local
> eddiebot@1.0.0 start:local /home/raisinten/Desktop/universe/git/EddieBot
> npm run build && node dist/index.js
> eddiebot@1.0.0 build /home/raisinten/Desktop/universe/git/EddieBot
> tsc
[1601308601188] INFO (504 on hp): Scheduling the job opensource-reminder
[1601308601192] ERROR (504 on hp): Channel not found
(node:504) UnhandledPromiseRejectionWarning: Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.
at WebSocketManager.createShards (/home/raisinten/Desktop/universe/git/EddieBot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:260:15)
(node:504) 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:504) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
^C
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Admin Authentication API Errors | Firebase - Google
Admin Authentication API Errors ; auth/project-not-found, No Firebase project was found for the credential used to initialize the Admin SDKs.
Read more >Error Messages | Maps JavaScript API - Google Developers
Once you have located your project in the Cloud Console, check if a billing account is attached by navigating to the Billing section...
Read more >Authenticate using API keys - Google Cloud
API-first integration to connect existing data and applications. ... Solution to bridge existing care systems and apps on Google Cloud. ... No-code development ......
Read more >Android: Firebase Credentials - OneSignal Documentation
A Google Firebase Server Key is required for all Android mobile apps and Chrome app extensions. It is optional for Amazon apps. What...
Read more >Error: Could not find the correct Provider<User> above this ...
I'm getting this error when running my Flutter app and I have no clue about how to fix it. I suspect that the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The reason you get this error is either you didn’t set the correct bot channel id in
.env
file https://github.com/EddieJaoudeCommunity/EddieBot/blob/2c8adb209b1b397914025cd4f0f595743e7b4654/.env.example#L5-L6or because
scheduleOpenSourceReminder
inindex.ts
starts executing and logging to the bot channel before the bot is ready.To fix it, move
scheduleOpenSourceReminder
on index.ts:41 https://github.com/EddieJaoudeCommunity/EddieBot/blob/2c8adb209b1b397914025cd4f0f595743e7b4654/src/index.ts#L41 to index.ts:16 so it start executing when the bot is ready. https://github.com/EddieJaoudeCommunity/EddieBot/blob/2c8adb209b1b397914025cd4f0f595743e7b4654/src/index.ts#L14-L16Of course, PRs are always welcome 🎉
I’m curious to know why it didn’t work for you, could you show me what you did and didn’t work 😁 Because I tried the example
and it worked.