Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Commit

Permalink
Improve ctcp version response.
Browse files Browse the repository at this point in the history
Configurable ctcp finger response.
  • Loading branch information
cnaude committed Dec 27, 2014
1 parent 82f3868 commit ebe2046
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 52 deletions.

This file was deleted.

11 changes: 9 additions & 2 deletions src/main/java/com/cnaude/purpleirc/PurpleBot.java
Expand Up @@ -31,7 +31,6 @@
import com.cnaude.purpleirc.IRCListeners.QuitListener;
import com.cnaude.purpleirc.IRCListeners.ServerResponseListener;
import com.cnaude.purpleirc.IRCListeners.TopicListener;
import com.cnaude.purpleirc.IRCListeners.VersionListener;
import com.cnaude.purpleirc.IRCListeners.WhoisListener;
import com.cnaude.purpleirc.Utilities.CaseInsensitiveMap;
import com.dthielke.herochat.Chatter;
Expand Down Expand Up @@ -153,6 +152,8 @@ public final class PurpleBot {
boolean joinNoticePrivate;
boolean joinNoticeCtcp;
String joinNoticeMessage;
String version;
String finger;

/**
*
Expand Down Expand Up @@ -204,15 +205,21 @@ public PurpleBot(File file, PurpleIRC plugin) {
config = new YamlConfiguration();
loadConfig();
addListeners();
version = plugin.getDescription().getFullName() + ", "
+ plugin.getDescription().getDescription() + " - "
+ plugin.getDescription().getWebsite();
buildBot();
messageQueue = new IRCMessageQueueWatcher(this, plugin);

}

public void buildBot() {
Configuration.Builder configBuilder = new Configuration.Builder()
.setName(botNick)
.setLogin(botLogin)
.setAutoNickChange(true)
.setVersion(version)
.setFinger(finger)
.setCapEnabled(true)
.setMessageDelay(chatDelay)
.setRealName(botRealName)
Expand Down Expand Up @@ -282,7 +289,6 @@ private void addListeners() {
ircListeners.add(new PrivateMessageListener(plugin, this));
ircListeners.add(new QuitListener(plugin, this));
ircListeners.add(new TopicListener(plugin, this));
ircListeners.add(new VersionListener(plugin));
ircListeners.add(new WhoisListener(plugin, this));
ircListeners.add(new MotdListener(plugin, this));
ircListeners.add(new ServerResponseListener(plugin, this));
Expand Down Expand Up @@ -613,6 +619,7 @@ private void loadConfig() {
botIdentPassword = config.getString("ident-password", "");
commandPrefix = config.getString("command-prefix", ".");
chatDelay = config.getLong("message-delay", 1000);
finger = config.getString("finger-reply", "PurpleIRC");
plugin.logDebug("Message Delay => " + chatDelay);
quitMessage = ChatColor.translateAlternateColorCodes('&', config.getString("quit-message", ""));
plugin.logDebug("Nick => " + botNick);
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/SampleBot.yml
Expand Up @@ -41,6 +41,8 @@ command-prefix: '.'
quit-message: '&r[&5PurpleIRC&r] &rGood bye!'
# Message delay in milliseconds (be careful when changing this)
message-delay: 1000
# CTCP finger reply
finger-reply: ''
# send a raw message on connect
raw-message-on-connect: false
# the raw message
Expand Down

0 comments on commit ebe2046

Please sign in to comment.