Skip to content

Commit

Permalink
Fixed a bug in the help command and added a nick var.
Browse files Browse the repository at this point in the history
  • Loading branch information
GUIpsp committed May 21, 2011
1 parent b97708e commit f4366af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions net/GUIpsp/GuiBot/GuiBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class GuiBot extends PircBot {
public static String pref = "$";

public GuiBot() {
this.setName("GuiBot");
this.setName(Main.nick);
}

public void onMessage(String channel, String sender, String login,
Expand Down Expand Up @@ -45,10 +45,10 @@ public void onMessage(String channel, String sender, String login,
} else {
for (Map.Entry<String, String> entry : Main.helpmap
.entrySet()) {
toprint += entry.getKey();
toprint += entry.getKey()+" ";
}
}
Main.bot.sendMessage(channel, toprint);
Main.bot.sendMessage(channel, toprint.trim());
} else if (Main.cmdmap.containsKey(first)) {
try {
Method met = (Method) Main.cmdmap.get(first);
Expand Down
5 changes: 3 additions & 2 deletions net/GUIpsp/GuiBot/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ public class Main {
public static Map<String, String> helpmap = new HashMap<String, String>();
static String plugdir = "/home/guipsp/Desktop/GuiBot/plugins/";
static File directory = new File(plugdir);
public static String nick = "GuiBot";
public static GuiBot bot = new GuiBot();

public static void main(String[] args) throws Throwable {

reLoad();
bot.setVerbose(true);
try {
Expand All @@ -25,7 +26,7 @@ public static void main(String[] args) throws Throwable {
// bot.identify("");
bot.joinChannel("##crow");
}

public static void reLoad() throws Throwable {
classmap.clear();
cmdmap.clear();
Expand Down

0 comments on commit f4366af

Please sign in to comment.