+ return new Promise((resolve, reject) => {
+ this.connection.query(`SELECT * FROM ${Config.mysql.tableName} ORDER BY RAND() LIMIT 1`, (err, results) => {
+
+ if (err) {
+ console.error('Error while fetching row');
+ console.error(err.message);
+ return reject(err);
+ }
+
+ if (results.length === 0) {
+ const error = new Error('No rows found.');
+ console.error('Error while fetching row');
+ console.error(error.message);
+ return reject(err);
+ }
+
+ const row = results[0];
+
+ return resolve({
+ looks: row.l,
+ good: row.g,
+ to: row.t,
+ me: row.m,
+ emoji: row.emoji
+ });
+ });