public void onEnable() { File dir = new File("data", "quotes"); dir.mkdir(); File[] files = dir.listFiles(); for (File f : files) { if (f.isDirectory()) return; String channel = f.getName(); BinBuffer binb = new BinFile(f).read(); binb.setPos(0); quotes.put(channel, new ArrayList<Quote>()); while (binb.bytesLeft() > 0) { String[] nicks = binb.readUString().split(" "); String quote = binb.readUString(); quotes.get(channel).add(new Quote(nicks, quote)); } } Command.addCommands( this, cmd = new CmdQuote(), cmdAdd = new CmdQuoteAdd(), cmdRemove = new CmdQuoteRemove()); Command.addCommand(this, "q", cmd); Command.addCommand(this, "qadd", cmdAdd); Command.addCommand(this, "qdel", cmdRemove); }
public void onEnable(File dir) { Command.addCommands(this, cmd = new CmdQuestionParty()); Command.addCommand(this, "qparty", cmd); }