From ce251272999d135a00b3241ffb5b7312ff3591ee Mon Sep 17 00:00:00 2001 From: Juhani Haverinen Date: Tue, 5 Sep 2017 15:09:57 +0300 Subject: [PATCH] Implement the hymmnos dictionary search feature --- ircbot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ircbot.py b/ircbot.py index 8f47a1c..d35965c 100644 --- a/ircbot.py +++ b/ircbot.py @@ -8,6 +8,7 @@ import channel from constants import logmessage_types, internal_submessage_types, controlmessage_types import line_handling +import botcmd Server = namedtuple('Server', ['host', 'port', 'nick', 'realname', 'channels']) @@ -229,6 +230,8 @@ def spawn_loggerthread(): if __name__ == '__main__': server = Server(host = 'irc.freenode.net', port = 6667, nick = 'HynneFlip', realname = 'HynneFlip IRC bot', channels = ['##ingsoc']) + botcmd.initialize() + logging_channel, dead_notify_channel = spawn_loggerthread() control_channel = spawn_serverthread(server, logging_channel) @@ -240,7 +243,9 @@ if __name__ == '__main__': cmd = input('') if cmd == 'q': + print('Keyboard quit') control_channel.send((controlmessage_types.quit,)) + logging_channel.send((logmessage_types.internal, internal_submessage_types.quit)) break elif len(cmd) > 0 and cmd[0] == '/':