Allow using custom nickserv for IRC bot (Thanks aezarkones)

This commit is contained in:
UnknownShadow200 2017-10-27 19:25:56 +11:00
parent fe67055701
commit efd995390f
2 changed files with 7 additions and 2 deletions

View File

@ -297,9 +297,12 @@ namespace MCGalaxy.Network {
}
void Authenticate() {
string nickServ = ServerConfig.IRCNickServName;
if (nickServ.Length == 0) return;
if (ServerConfig.IRCIdentify && ServerConfig.IRCPassword.Length > 0) {
Logger.Log(LogType.IRCCActivity, "Identifying with NickServ");
bot.connection.Sender.PrivateMessage("NickServ", "IDENTIFY " + ServerConfig.IRCPassword);
Logger.Log(LogType.IRCCActivity, "Identifying with " + nickServ);
bot.connection.Sender.PrivateMessage(nickServ, "IDENTIFY " + ServerConfig.IRCPassword);
}
}

View File

@ -154,6 +154,8 @@ namespace MCGalaxy {
public static string IRCOpChannels = "#changethistoo";
[ConfigBool("irc-identify", "IRC bot", false)]
public static bool IRCIdentify = false;
[ConfigString("irc-nickserv-name", "IRC bot", "NickServ", true)]
public static string IRCNickServName = "NickServ";
[ConfigString("irc-password", "IRC bot", "", true)]
public static string IRCPassword = "";