If I try to approve bug 11, it approves bug 1. Please help solve this problem bot, does not perceive numbers consisting of two digits at all
client.on('message', async (message, member, channel) => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
var args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
args = args.join(" ");
let perms = message.member.permissions;
if (command === 'accept') {
const user = await message.guild.members.cache.get(message.author.id)
if (!user.roles.cache.get(ApprovoredRoleID)) return message.reply('Доступно только охотникам за багами')
if (!args[0]) return message.reply('Укажите Bug-ID')
var SelectBug = await BugScheme.findOne({ id: args[0] });
if (!SelectBug) return message.reply('Я не могу найти идентификатор отчета.')
if (SelectBug.reportStatus != 'none') return message.reply('Этот отчет уже перемещен.')
var bug = client.channels.cache.get(BugsChannel)
bug.messages.fetch({around: SelectBug.messageid, limit: 1})
.then(msg => {
const fetchedMsg = msg.first();
fetchedMsg.edit(`**───────────────────**\n<@${SelectBug.owner}> сообщил\n\n**Название:** ${SelectBug.title}\n**Описание:** ${SelectBug.description}\n\nПроверил ${message.author} <:yes:917708321056768000>\nID отчета: **${SelectBug.id}**`);
});
SelectBug.reportStatus = 'accept'
SelectBug.save()
This is because you are only getting the first character of the string. Remove args = args.join(" ") and do this instead:
var SelectBug = await BugScheme.findOne({ id: args.join("") })