public static void deliverQueue() {

        Runnable resetCommandLimit = () -> {
            if(!botMessages.isEmpty()) {
                Iterator it = botMessages.entrySet().iterator();
                while (it.hasNext()) try {
                    Entry m = (Entry) it.next();
                    String s = (String) m.getKey();
                    String c = (String) m.getValue();
                    sendMessage(s, c);
                    it.remove();
                    Thread.sleep(2000);
                } catch (IOException | InterruptedException e) {
                    e.printStackTrace();
                }
                if (getDebug()) showLevelMessage(INFO, "Messages sent from queue");
            } else if (getDebug()) showLevelMessage(INFO, "Message queue empty");
        };

        queueDeliveryExecutor = Executors.newScheduledThreadPool(1);
        queueDeliveryExecutor.scheduleAtFixedRate(resetCommandLimit, 0, 5, TimeUnit.SECONDS);

    }