File tree 1 file changed +35
-0
lines changed 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { config } from 'dotenv' ;
2
+ import { Client , RichEmbed } from 'discord.js' ;
3
+
4
+ config ( ) ;
5
+ const { TOKEN_DISCORD } = process . env
6
+ const bot = new Client ( ) ;
7
+
8
+ bot . on ( 'ready' , ( ) => {
9
+ console . log ( `Logged in as ${ bot . user . tag } ` ) ;
10
+ console . log ( `Exit ${ bot . user . tag } : ctrl + c` ) ;
11
+ } ) ;
12
+
13
+ bot . on ( 'message' , ( msg ) => {
14
+ const { content } = msg
15
+ const cmds = {
16
+ "!invite" : 'https://discord.gg/kYBtYPj' ,
17
+ "!azurePipelines" : 'https://azure.microsoft.com/pt-br/services/devops/pipelines/' ,
18
+ "!youtube" : 'https://youtube.com/collabcode' ,
19
+ } ;
20
+
21
+ cmds [ content ] && msg . reply ( cmds [ content ] ) ;
22
+ } ) ;
23
+
24
+ bot . on ( 'message' , ( message ) => {
25
+ if ( message . content === 'embed' ) {
26
+ const embed = new RichEmbed ( )
27
+ . setTitle ( 'A slick little embed' )
28
+ . setColor ( 0xFF0000 )
29
+ . setDescription ( 'Hello, this is a slick embed!' ) ;
30
+
31
+ message . channel . send ( embed ) ;
32
+ }
33
+ } )
34
+
35
+ bot . login ( TOKEN_DISCORD )
You can’t perform that action at this time.
0 commit comments