fix in naming
This commit is contained in:
		
							
								
								
									
										5
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								index.js
									
									
									
									
									
								
							@ -13,7 +13,7 @@ const Chat = mongoose.model('Chat', chatSchema)
 | 
				
			|||||||
const Trigger = mongoose.model('Trigger', triggerSchema)
 | 
					const Trigger = mongoose.model('Trigger', triggerSchema)
 | 
				
			||||||
const Warning = mongoose.model('Warning', warningSchema)
 | 
					const Warning = mongoose.model('Warning', warningSchema)
 | 
				
			||||||
let me
 | 
					let me
 | 
				
			||||||
let updating = false
 | 
					let update = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const MarkdownEscape = /_|\*|\[|\]|\(|\)|~|`|>|#|\+|-|=|\||{|}|\.|!/g
 | 
					const MarkdownEscape = /_|\*|\[|\]|\(|\)|~|`|>|#|\+|-|=|\||{|}|\.|!/g
 | 
				
			||||||
@ -54,7 +54,7 @@ bot.onText(/^\/update_db/, async(msg, match) => {
 | 
				
			|||||||
    if(chatMember.status == "administrator" || chatMember.status == "creator"){
 | 
					    if(chatMember.status == "administrator" || chatMember.status == "creator"){
 | 
				
			||||||
        update = true 
 | 
					        update = true 
 | 
				
			||||||
        bot.sendMessage(msg.chat.id, "База данного чата обновляется, подождите, пожалуйста.")
 | 
					        bot.sendMessage(msg.chat.id, "База данного чата обновляется, подождите, пожалуйста.")
 | 
				
			||||||
        const result = await updateDB(msg.chat.id)
 | 
					        await updateDB(msg.chat.id)
 | 
				
			||||||
        bot.sendMessage(msg.chat.id, "База чата успешно обновлена! Благодарю за ожидание :3")
 | 
					        bot.sendMessage(msg.chat.id, "База чата успешно обновлена! Благодарю за ожидание :3")
 | 
				
			||||||
        update = false
 | 
					        update = false
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -648,6 +648,7 @@ async function updateDB(id) {
 | 
				
			|||||||
        await sleep(200)
 | 
					        await sleep(200)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    console.log("WE ARE DONE")
 | 
					    console.log("WE ARE DONE")
 | 
				
			||||||
 | 
					    return true
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function sleep(ms) {
 | 
					function sleep(ms) {
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user