org.elite.jdcbot.util
Class StaticCommands

java.lang.Object
  extended by org.elite.jdcbot.util.MySQLWork
      extended by org.elite.jdcbot.util.StaticCommands

public class StaticCommands
extends MySQLWork

Simple MySQLWork extended class that gets static command (command with static output) from MySQL database. For creating this table, find command.sql in downloaded framework and run it. Also, you should change name of database, username and password in constructor

Since:
0.6
Version:
0.7
Author:
Kokanovic Branko, AppleGrew

Field Summary
protected  java.util.HashMap<java.lang.String,java.lang.String> cmds
           
 
Fields inherited from class org.elite.jdcbot.util.MySQLWork
stmt
 
Constructor Summary
StaticCommands()
           
 
Method Summary
 java.lang.String parseCommand(java.lang.String cmd)
          Tries to get command output from database
 
Methods inherited from class org.elite.jdcbot.util.MySQLWork
displaySQLErrors, finalize
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cmds

protected java.util.HashMap<java.lang.String,java.lang.String> cmds
Constructor Detail

StaticCommands

public StaticCommands()
Method Detail

parseCommand

public java.lang.String parseCommand(java.lang.String cmd)
Tries to get command output from database

Parameters:
cmd - Command that was on main chat for which we search output (e.g. +help)
Returns:
Empty string ("") if command was not found in database, command output otherwise (e.g. "Output some help")