File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ for (const file of commandFiles) {
1616 client . commands . set ( command . name , command ) ;
1717}
1818//Used Database Variables
19+ let guild = client . guilds . cache . map ( guild => guild . id ) ;
1920let id ;
2021let prefix ;
2122//client on ready event (when the bot starts)
@@ -26,7 +27,7 @@ client.once('ready', () => {
2627 ( async ( ) => {
2728 try {
2829 //Fetch the Model for each guild the bot is in
29- const req = await GuildModel . findOne ( { id : client . guilds . cache . map ( guild => guild . id ) } ) ;
30+ const req = await GuildModel . find ( { id : guild } ) ;
3031 //Request the information
3132 id = req . id ;
3233 prefix = req . prefix ;
@@ -50,6 +51,7 @@ client.on('guildCreate', async guild => {
5051} ) ;
5152//Message Listener
5253client . on ( 'message' , message => {
54+ /*
5355 if (message.content === "!sync" || !message.author.bot) {
5456 (async () => {
5557 try {
@@ -62,6 +64,7 @@ client.on('message', message => {
6264 }
6365 })();
6466 }
67+ */
6568 //If a message does not start with the prefix don't run it as a command
6669 if ( ! message . content . startsWith ( prefix ) || message . author . bot ) return ;
6770 //Set the command prefix
You can’t perform that action at this time.
0 commit comments