From a0b4f51fef71a7c60e5b0b7feaf8eaf2ba73271c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Wed, 6 Sep 2017 20:47:32 +0300 Subject: [PATCH] Add a stub botcmd.py --- botcmd.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 botcmd.py diff --git a/botcmd.py b/botcmd.py new file mode 100644 index 0000000..5bdf880 --- /dev/null +++ b/botcmd.py @@ -0,0 +1,25 @@ +# initialize() +# Called to initialize the IRC bot +# Runs before even logger is brought up, and blocks further bringup until it's done +def initialize(): + ... + +# handle_message(*, prefix, message, nick, channel, irc) +# Called for PRIVMSGs. +# prefix is the prefix at the start of the message, without the leading ':' +# message is the contents of the message +# nick is who sent the message +# channel is where you should send the response (note: in queries nick == channel) +# irc is the IRC API object +# All strings are bytestrings or bytearrays +def handle_message(*, prefix, message, nick, channel, irc): + ... + +# handle_nonmessage(*, prefix, command, arguments, irc) +# Called for all other commands than PINGs and PRIVMSGs. +# prefix is the prefix at the start of the message, without the leading ':' +# command is the command or number code +# arguments is rest of the arguments of the command, represented as a list. ':'-arguments are handled automatically +# All strings are bytestrings or bytearrays +def handle_nonmessage(*, prefix, command, arguments, irc): + ...