X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/aaa8eb8dc2f1e1237d44344488ec4cde9c0b0076..b5e5c4470d993b41113ae43b7f5030d412585430:/modules/example_socket.py diff --git a/modules/example_socket.py b/modules/example_socket.py index 1f6563d..dc90767 100644 --- a/modules/example_socket.py +++ b/modules/example_socket.py @@ -25,7 +25,7 @@ modstop = lib.modstop # - listen on the socket `sock.listen()` # - accept `sock.accept()` # -# Once a connection is accepted, your class is instantiated with the client socket. +# Once a connection is accepted, your class is instantiated with the client socket. (And the optional third argument you passed to bind_*, or None) # - When data comes in on the client socket, your `getdata` method will be called. It should return a list of strings. # - For each element in the list returned by `getdata`, `parse` will be called. # - When the socket is being closed by the bot (f.e. your module is unloaded), the optional method `closing` will be called. @@ -36,7 +36,7 @@ modstop = lib.modstop @lib.bind_tcp('0.0.0.0', 12543) class BasicServer(object): - def __init__(self, sock): + def __init__(self, sock, data): self.chan = lib.parent.cfg.get('basic_socket', 'channel', '#') self.buffer = b'' self.sock = sock