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); } } }
public static AsyncMessageSender getInstance(JDA api, String ratelimitIdentifier) { Map<String, AsyncMessageSender> senders = instances.get(api); if (senders == null) { senders = new HashMap<>(); instances.put(api, senders); } AsyncMessageSender sender = senders.get(ratelimitIdentifier); if (sender == null) { sender = new AsyncMessageSender(((JDAImpl) api), ratelimitIdentifier); senders.put(ratelimitIdentifier, sender); } return sender; }
@Override public PermissionOverride getOverrideForRole(Role role) { return rolePermissionOverrides.get(role); }
@Override public PermissionOverride getOverrideForUser(User user) { return userPermissionOverrides.get(user); }