File tree Expand file tree Collapse file tree 3 files changed +1266
-1345
lines changed Expand file tree Collapse file tree 3 files changed +1266
-1345
lines changed Original file line number Diff line number Diff line change 1313 "author" : " Çetin Kaan Taşkıngenç" ,
1414 "license" : " ISC" ,
1515 "dependencies" : {
16- "bing-translate-api" : " ^2.2.1 " ,
16+ "bing-translate-api" : " ^2.6.0 " ,
1717 "discord.js" : " ^13.6.0" ,
18- "dotenv" : " ^14.2 .0" ,
18+ "dotenv" : " ^16.0 .0" ,
1919 "fastest-levenshtein" : " ^1.0.12" ,
2020 "memejs" : " ^2.0.1" ,
2121 "mongo-sanitize" : " ^1.1.0" ,
22- "mongodb" : " ^4.3.1 " ,
23- "mongoose" : " ^6.1.7 " ,
24- "yarn-upgrade-all" : " ^0.6 .1"
22+ "mongodb" : " ^4.5.0 " ,
23+ "mongoose" : " ^6.3.2 " ,
24+ "yarn-upgrade-all" : " ^0.7 .1"
2525 },
2626 "devDependencies" : {
2727 "@types/mongo-sanitize" : " ^1.0.1" ,
28- "@types/node" : " ^17.0.10 " ,
29- "nodemon" : " ^2.0.15 " ,
30- "prettier" : " ^2.5.1 " ,
31- "ts-node" : " ^10.4 .0" ,
32- "typescript" : " ^4.5 .4"
28+ "@types/node" : " ^17.0.31 " ,
29+ "nodemon" : " ^2.0.16 " ,
30+ "prettier" : " ^2.6.2 " ,
31+ "ts-node" : " ^10.7 .0" ,
32+ "typescript" : " ^4.6 .4"
3333 }
3434}
Original file line number Diff line number Diff line change 1- //<> with ❤️ by Çetin Kaan Taşkıngenç & Postman Student Leaders
1+ //<> with ❤️ by Çetin Kaan Taşkıngenç & Claire Froelich
22
33import { Client } from "discord.js" ;
44import mongoose from "mongoose" ;
@@ -65,25 +65,24 @@ client.on("messageCreate", (message: MessageType) => {
6565 //If the message does not start with the prefix return
6666 if ( ! message . content . startsWith ( prefix ) ) return ;
6767
68+ //get the message content without the prefix
6869 const args : string [ ] = message . content
6970 . slice ( prefix . length )
7071 . trim ( )
7172 . split ( / + / g) ;
7273
74+ //get the command
7375 const command : string = args . shift ( ) ! . toLowerCase ( ) ;
7476
7577 //Check if the command exists in the hashmap. It returns undefined if it doesn't exist
7678 const currCommand = commands . get ( command ) ;
77-
78- console . log ( currCommand ) ;
7979
8080
8181 //If the currCommand is not undefined,
82- if ( currCommand ) currCommand . callback ( message , args ) ;
82+ if ( currCommand )
83+ currCommand . callback ( message , args ) ;
8384 else
84- message . channel . send (
85- `Command not found! Type ${ prefix } help to see all commands`
86- ) ;
85+ message . channel . send ( `Command not found! Type ${ prefix } help to see all commands` ) ;
8786} ) ;
8887
8988client . login ( process . env . DISCORD_TOKEN ) ;
You can’t perform that action at this time.
0 commit comments