puppet-padlocal icon indicating copy to clipboard operation
puppet-padlocal copied to clipboard

Rooms left before are still on the list.

Open willin opened this issue 3 years ago • 1 comments

bot.on('ready', async () => {
  const rooms = await bot.Room.findAll();
  for (const room of rooms) {
    log.info('Room', room);
    const members = await room.memberAll();
    log.info('Members', members);
  }
});
image

there are 6 groups returned in Room.findAll, however, 4 of them are already disbanded.

How to delete them from the findAll result or how to get real rooms which exists?

willin avatar Jan 24 '22 07:01 willin

Interesting, my result is exactly on the contrary -- I got way few rooms than I'm in, from the bot.Room.findAll() output.

I think what happened might be, it remembers and logs all the rooms it had received message before, since login.

Are you doing such ... Ah, no, you're doing it at bot.on('ready'. Hmm, bot on ready should be before on login, right?

suntong avatar Feb 27 '22 21:02 suntong