Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.brojo.plugins;
- import java.util.Random;
- public class DancePlugin extends BrojoPlugin {
- @Override
- public String getName() {
- return "Test";
- }
- @Override
- public String getVersion() {
- return "0.01";
- }
- @Override
- public String getDescription() {
- return "Test Plugin for BrojoBot, outputs 'Doop' when the user types ',hello'";
- }
- /**
- * @param m Message received
- * @return whether this plugin should be loaded
- */
- public static boolean accepts(Message m) {
- return m.getContents().toLowerCase().equals(":D") && m.getContents().toLowerCase().length() > 2;
- }
- @Override
- public boolean onActivated(IConnector impl, Message message) {
- String msg = "";
- Random rand = new Random();
- int choice = rand.nextInt(4);
- if (choice == 0) msg = ":D]-<";
- if (choice == 1) msg = ":D[-<";
- if (choice == 2) msg = ":D/-<";
- if (choice == 3) msg = ":D\-<";
- impl.send(message.getRecipient(), msg);
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement