let page = 0;
let users = await User.find({guild:interaction.guild.id,level:{$ne:null}}).sort({ level: -1 }).limit(5)
let text = '';
let userss = await User.findOne({ userID: interaction.user.id ,guild:interaction.guild.id}) || new User({ userID: interaction.user.id,guild:interaction.guild.id });
let n = 0;
for (const user of users) {
n++;
let u = interaction.guild.members.cache.get(user.userID);
if (!u) {
await User.deleteOne({userID:user.userID,guild:interaction.guild.id})
break;
}
let a = u.user.username || "пусто";
text += `**#${n}. ${a}**\n${user.level} уровень | ${user.msg}xp\n\n`;
};