src/utils/bot-utils.js
/**
   * Makes a connection string for a Mongo DB based on the bot's preference
   * @param  {PrefsManager} prefsManager preferences manager
   * @return {string}                    the result connection string
   */
Makes a connection string for a Mongo DB based on the bot's preference
@param  {PrefsManager} prefsManager preferences manager
@return {string}                    the result connection string
Makes a connection string for a Mongo DB based on the bot ' s preference @param { PrefsManager } prefsManager preferences manager @return { string } the result connection string
static makeDbConnectionString(prefsManager) {
    if (prefsManager.db_host === undefined || prefsManager.db_name === undefined) {
      return '';
    }
    let result = MongoProtocol + '://';
    if (prefsManager.db_username !== undefined) {
      result += prefsManager.db_username;
      if (prefsManager.db_password !== undefined) {
        result += ':' + prefsManager.db_password;
      }
      result += '@';
    }
    result += prefsManager.db_host;
    if (prefsManager.db_port !== undefined) {
      result += ':' + prefsManager.db_port;
    }
    result += '/' + prefsManager.db_name;
    return result;
  }
static makeDbConnectionString ( prefsManager ) { if ( prefsManager . db_host === undefined || prefsManager . db_name === undefined ) { return '' ; } let result = MongoProtocol + '://' ; if ( prefsManager . db_username !== undefined ) { result += prefsManager . db_username ; if ( prefsManager . db_password !== undefined ) { result += ':' + prefsManager . db_password ; } result += '@' ; } result += prefsManager . db_host ; if ( prefsManager . db_port !== undefined ) { result += ':' + prefsManager . db_port ; } result += '/' + prefsManager . db_name ; return result ; }
Makes a connection string for a Mongo DB based on the bot's preference
 @param  {PrefsManager} prefsManager preferences manager
 @return {string}                    the result connection string
Makes a connection string for a Mongo DB based on the bot ' s preference @param { PrefsManager } prefsManager preferences manager @return { string } the result connection string