@Override
    public void run() {
        if (bots.isEmpty()) {
            throw new IllegalStateException("At least one bot is necessary");
        }

        while (running()) {
            Bot b = bots.poll();

            try {


                lastMessage = b.getNextMessage(lastMessage).trim();

                if (lastMessage.isEmpty()) {
                    continue;
                }

                Message msg = new Message();
                msg.bot = b;
                msg.msg = lastMessage;

                messages.add(msg);
            } catch (Exception ex) {
                System.err.println("Exception on bot " + b + ": " + ex.getMessage());
            } finally {
                bots.add(b);
            }

        }
    }