示例#1
0
 public static synchronized void stop(JDA api, String ratelimitIdentifier) {
   Map<String, AsyncMessageSender> senders = instances.get(api);
   if (senders != null && !senders.isEmpty()) {
     AsyncMessageSender sender = senders.get(ratelimitIdentifier);
     if (sender != null) {
       sender.kill();
       senders.remove(ratelimitIdentifier);
     }
   }
 }
示例#2
0
 public static synchronized void stopAll(JDA api) {
   Map<String, AsyncMessageSender> senders = instances.get(api);
   if (senders != null && !senders.isEmpty()) {
     senders
         .values()
         .forEach(
             sender -> {
               sender.kill();
             });
     senders.clear();
   }
 }