Вот код:
module.exports.run = async(bot, message, args) => {
const mysql = require('mysql');
const config = require('../config.json');
// const {MessageEmbed} = require('discord.js');
const conn = mysql.createConnection({
host: config.mysql_host,
user: config.mysql_user,
database: config.mysql_database,
password: config.mysql_password
});
const rUser = "SELECT * FROM users"
conn.query(rUser, (err, result) => {
if(err) console.log(err);
const users = result;
for(let i = 0; i < users.length; i++){
// const user = new MessageEmbed().setColor(config.goodcolor).addField(`${users[i].tag}`, `lvl:${users[i].lvl}, xp: ${users[i].xp}, warns: ${users[i].warns}`)
message.channel.send(users[i].tag);
}
});
};
module.exports.help = {
name: "db"
}