diff --git a/.gitignore b/.gitignore index bc78471..8633f8c 100644 --- a/.gitignore +++ b/.gitignore @@ -482,3 +482,9 @@ $RECYCLE.BIN/ # Vim temporary swap files *.swp + +lib64 +lib +bin +pyvenv.cfg +data/UnaskedTriviaQuestions.json diff --git a/IRCBot.cs b/IRCBot.cs index 1080d6d..c5b2271 100644 --- a/IRCBot.cs +++ b/IRCBot.cs @@ -66,22 +66,17 @@ public abstract class IRCBot SendLine($"PRIVMSG {channel} :{message}"); } - public void JoinAllChannels() - { - if (Channels != null) - { - foreach (string channel in Channels) - { - JoinChannel(channel); - } - } - } - public void JoinChannel(string channel) { SendLine($"JOIN {channel}"); } + public void JoinChannels(string[] channels) + { + foreach (string channel in channels) + JoinChannel(channel); + } + public void PartChannel(string channel) { SendLine($"PART {channel}"); diff --git a/bots/Cube.cs b/bots/Cube.cs index d72b2f9..757685b 100644 --- a/bots/Cube.cs +++ b/bots/Cube.cs @@ -5,8 +5,8 @@ public class Cube : IRCBot public Cube(string host, int port, string nick, string realname) : base(host, port, nick, realname) { - Channels = [ - "#bots" + string[] channels = [ + "#bots", ]; (string, Action)[] commands = [ @@ -14,13 +14,11 @@ public class Cube : IRCBot ]; HookCommands(commands); - JoinAllChannels(); + JoinChannels(channels); } private void Echo(PRIVMSG privmsg) { SendPrivmsg(privmsg.Sender, privmsg.Body); } - - } \ No newline at end of file