Skip to content

Commit

Permalink
Fixed problem where all AccountTypes were using ClientRateLimiter. (Y…
Browse files Browse the repository at this point in the history
…es, even bots)
  • Loading branch information
DV8FromTheWorld committed Nov 9, 2016
1 parent a237fbc commit 7726cdf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -64,7 +64,7 @@ public class JDAImpl implements JDA

protected HttpHost proxy;
protected WebSocketClient client;
protected Requester requester = new Requester(this);
protected Requester requester;
protected IEventManager eventManager = new InterfacedEventManager();
protected Status status = Status.INITIALIZING;
protected SelfUser selfUser;
Expand All @@ -80,6 +80,7 @@ public JDAImpl(AccountType accountType, HttpHost proxy, boolean autoReconnect, b
{
this.presence = new PresenceImpl(this);
this.accountType = accountType;
this.requester = new Requester(this);
this.proxy = proxy;
this.autoReconnect = autoReconnect;
this.audioEnabled = audioEnabled;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/net/dv8tion/jda/core/requests/Requester.java
Expand Up @@ -52,6 +52,9 @@ public Requester(JDA api)

public Requester(JDA api, AccountType accountType)
{
if (accountType == null)
throw new NullPointerException("Provided accountType was null!");

this.api = api;
if (accountType == AccountType.BOT)
rateLimiter = new BotRateLimiter(this, 5);
Expand Down

0 comments on commit 7726cdf

Please sign in to comment.