Skip to content

Commit

Permalink
Added .mazaaddbeancoin and changed orders of commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazawrath committed Sep 19, 2018
1 parent 182cf61 commit ccfd373
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/main/java/com/mazawrath/beanbot/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.mazawrath.beanbot.commands.GivemodCommand;
import com.mazawrath.beanbot.commands.beancoin.*;
import com.mazawrath.beanbot.commands.copypasta.*;
import com.mazawrath.beanbot.commands.maza.MazaAddBeanCoinCommand;
import com.mazawrath.beanbot.commands.maza.MazapostchangelogCommand;
import com.mazawrath.beanbot.utilities.Points;
import de.btobastian.sdcf4j.CommandHandler;
Expand All @@ -26,26 +27,28 @@ public static void main(String[] args) {

// Register commands

// Copypasta
cmdHandler.registerCommand(new Top500Command(dbConn));
cmdHandler.registerCommand(new GivemodCommand(dbConn));
cmdHandler.registerCommand(new ThirtyPercentWinrateCommand(dbConn));
cmdHandler.registerCommand(new CoderedCommand(dbConn));
cmdHandler.registerCommand(new BlessedCommand(dbConn));
cmdHandler.registerCommand(new StfuCommand(dbConn));
// Standard
cmdHandler.registerCommand(new HelpCommand(cmdHandler));
cmdHandler.registerCommand(new UserinfoCommand(dbConn));
cmdHandler.registerCommand(new ServerInfoCommand());
cmdHandler.registerCommand(new ReactCommand(dbConn));
cmdHandler.registerCommand(new SourceCommand());
// beanCoin
cmdHandler.registerCommand(new BeanbalanaceCommand(dbConn));
cmdHandler.registerCommand(new BeanfreeCommand(dbConn));
cmdHandler.registerCommand(new BeanbetCommand(dbConn));
cmdHandler.registerCommand(new BeanboardCommand(dbConn));
cmdHandler.registerCommand(new BeanTransferCommand(dbConn));
cmdHandler.registerCommand(new BeanboardCommand(dbConn));
// Mazawrath commands
cmdHandler.registerCommand(new MazapostchangelogCommand());
// Other
cmdHandler.registerCommand(new ReactCommand(dbConn));
cmdHandler.registerCommand(new UserinfoCommand(dbConn));
cmdHandler.registerCommand(new ServerInfoCommand(dbConn));
cmdHandler.registerCommand(new HelpCommand(cmdHandler));
cmdHandler.registerCommand(new MazaAddBeanCoinCommand(dbConn));
// Copypasta
cmdHandler.registerCommand(new Top500Command(dbConn));
cmdHandler.registerCommand(new GivemodCommand(dbConn));
cmdHandler.registerCommand(new ThirtyPercentWinrateCommand(dbConn));
cmdHandler.registerCommand(new CoderedCommand(dbConn));
cmdHandler.registerCommand(new BlessedCommand(dbConn));
cmdHandler.registerCommand(new StfuCommand(dbConn));
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.mazawrath.beanbot.commands.maza;

import com.mazawrath.beanbot.utilities.Points;
import de.btobastian.sdcf4j.Command;
import de.btobastian.sdcf4j.CommandExecutor;
import org.javacord.api.entity.channel.ServerTextChannel;
import org.javacord.api.entity.server.Server;
import org.javacord.api.entity.user.User;

public class MazaAddBeanCoinCommand implements CommandExecutor {
private Points points;

public MazaAddBeanCoinCommand(Points pointsPassed) {
points = pointsPassed;
}

@Command(
aliases = {"mazaaddbeancoin"},
privateMessages = false,
showInHelpPage = false
)

public void onCommand(String command, String user, String pointValue, ServerTextChannel serverTextChannel, User author, Server server) {
if (author.isBotOwner()) {
serverTextChannel.sendMessage("Added " + pointValue + " beanCoin to " + user + ".");

points.addPoints(user, server.getIdAsString(), Integer.parseInt(pointValue));
}
}
}

0 comments on commit ccfd373

Please sign in to comment.