Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

253
Views
js does not see the second number

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()

mongo

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

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("") })
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!