Good coding practices
Use Libs
Use folders
// Before all command - @
// set your ADMIN_ID here
// you can get it via Bot.sendMessage(user.id)
var isAdmin = ( user && (user.id == ADMIN_ID) )
if(!command){
return
}
if((command.folder=="Admin Panel")&&(isAdmin){
// only admin can run command from Admin Panel's folder
// any common bjs here for admin
Bot.sendMessage("Hello, admin!")
}else{
Bot.sendMessage("Access denied");
return // exit from command now
}
// other example
if(command.folder=="Under development"){
Bot.sendMessage("Sorry this command on development")
}Use good names
Use simular names!

Use JSON property


Do not use many methods of getProperty or setProperty


Use functions!


Last updated


