File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ const { Client } = require ( "discord.js" ) ;
2+ const { config } = require ( "dotenv" ) ;
3+
4+ // Declares our bot,
5+ // the disableEveryone prevents the client to ping @everyone
6+ const client = new Client ( {
7+ disableEveryone : true
8+ } ) ;
9+
10+ config ( {
11+ path : __dirname + "/.env"
12+ } )
13+
14+ // When the bot's online, what's in these brackets will be executed
15+ client . on ( "ready" , ( ) => {
16+ console . log ( `Hi, ${ client . user . username } is now online!` ) ;
17+
18+ // Set the user presence
19+ client . user . setPresence ( {
20+ status : "online" ,
21+ game : {
22+ name : "me getting developed" ,
23+ type : "WATCHING"
24+ }
25+ } ) ;
26+ } )
27+
28+ // When a message comes in, what's in these brackets will be executed
29+ client . on ( "message" , async message => {
30+ console . log ( `${ message . author . username } said: ${ message . content } ` ) ;
31+ } ) ;
32+
33+ // Login the bot
34+ client . login ( process . env . TOKEN ) ;
You can’t perform that action at this time.
0 commit comments