Skip to content

Commit

Permalink
Moved the TodoCommand registration to be after the api object is crea…
Browse files Browse the repository at this point in the history
…ted, otherwise.. NPE.
  • Loading branch information
DV8FromTheWorld committed Feb 23, 2016
1 parent e315251 commit be2ecba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/net/dv8tion/discord/Yui.java
Expand Up @@ -109,7 +109,6 @@ private static void setupBot()
jdaBuilder.addListener(help.registerCommand(new ReloadCommand()));
jdaBuilder.addListener(help.registerCommand(new UpdateCommand()));
jdaBuilder.addListener(help.registerCommand(new PermissionsCommand()));
jdaBuilder.addListener(help.registerCommand(new TodoCommand(api)));

for (IrcConnectInfo info : settings.getIrcConnectInfos())
{
Expand Down Expand Up @@ -145,6 +144,8 @@ private static void setupBot()
api = jdaBuilder.buildBlocking();
Permissions.getPermissions().setBotAsOp(api.getSelfInfo());

api.addEventListener(help.registerCommand(new TodoCommand(api)));

//Creates and Stores all Discord endpoints in our Manager.
for (Guild guild : api.getGuilds())
{
Expand Down

0 comments on commit be2ecba

Please sign in to comment.