title: Discord.js - AFK Disappears After An Hour Or So
body: <p>I have an AFK Command, it works completely fine. It sets the AFK, it reminds that the user is AFK when pinged &amp; it removes the AFK when the user sends another message. BUT, there is a problem. For some reason, the bot removes the AFK after an hour or so. Just completely disappears: No reminders, no nothing, doesn't even remove the AFK!
  I wanna know why this happens</p>
  <pre class="lang-js prettyprint-override"><code>const db = require(`quick.db`)
  
  if (db.has(message.author.id + '.afk')) {
    let currentNickname = message.member.displayName
    let newNickname = currentNickname.replace(`[AFK]`, ``);
    message.channel.send(`Welcome Back ${message.author}!`).then(message =&gt; {
      message.delete({ timeout: 15000 })
    })
    message.member.setNickname(newNickname).catch(error =&gt; false);
    db.delete(message.author.id + '.afk')
    db.delete(message.author.id + '.messageafk')
    db.delete(message.author.id + '.time')
  }
  if(message.content.toLowerCase().startsWith('&gt;afk')) {
    let reason = message.content.split(' ').slice(1).join(' ')
    if(!reason) reason = `AFK`
    let nickname = message.member ? message.member.displayName : null;
    message.member.setNickname(`[AFK] ${nickname}`).catch(error =&gt; false);
    db.set(message.author.id + '.afk', 'true')
    db.set(message.author.id + '.messageafk', reason)
    db.set(message.author.id + '.time', Date.now())
    message.channel.send(`${message.author}, AFK Set: ${reason}`)
  }
  message.mentions.users.forEach(user =&gt; {
    let timestamp = db.get(user.id + '.time')
    let timeAgo = moment(timestamp).fromNow()
    if (db.has(user.id + '.afk')) message.channel.send(user.username + ` Is AFK: ` + db.get(user.id + '.messageafk') + `
          - ${timeAgo}`)
  })
  </code></pre>