Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6afa5c5
Showing
4 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Require dependencies | ||
const { Client } = require('discord.js'); | ||
const dotenv = require('dotenv'); | ||
|
||
// Load environment variables | ||
dotenv.config(); | ||
|
||
// Create a bot instance | ||
const bot = new Client(); | ||
|
||
// Log our bot in | ||
bot.login(process.env.DISCORD_BOT_TOKEN); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "crypto-discord-bot", | ||
"version": "1.0.0", | ||
"description": "A Discord bot which fetches cryptocurrency prices and news", | ||
"main": "bot.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"discord", | ||
"bot", | ||
"crypto" | ||
], | ||
"author": "Nitin Ranganath", | ||
"license": "ISC", | ||
"dependencies": { | ||
"discord.js": "^12.5.1", | ||
"dotenv": "^8.2.0" | ||
} | ||
} |
6afa5c5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got an error with the "const bot = new Client();" when I typing the node. it shows "Client_Missing_intents". can you please advise what intents should we enter? thank you so much
6afa5c5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @judygreg54
I just checked the documentation and it seems like it has changed quite a bit. On line 2 on
bot.js
, change it to:And on line 9 of
bot.js
, change it to:Hope it helps. Here's the documentation: https://discord.js.org/#/docs/main/stable/general/welcome
6afa5c5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much master. please keep helping and sharing your knowledge to others. <3
6afa5c5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to help! :) Let me know if you face any other difficulties. @judygreg54