diff options
| author | 2018-09-26 18:27:17 +0100 | |
|---|---|---|
| committer | 2018-09-26 18:27:17 +0100 | |
| commit | 51a52e2b0e54031cce5876f54d1d48c268b5441c (patch) | |
| tree | a4c0e8e86c55aa701b06297d5b5a2ceebeaab60d /modules/dns.py | |
| parent | Also use docstrings to check if a command has help available, allow one-string (diff) | |
Switch to using @Utils.hook and docstrings for event hooks
Diffstat (limited to 'modules/dns.py')
| -rw-r--r-- | modules/dns.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/dns.py b/modules/dns.py index e5552aa8..19ef7ea0 100644 --- a/modules/dns.py +++ b/modules/dns.py @@ -1,13 +1,14 @@ import socket +from src import ModuleManager, Utils -class Module(object): +class Module(ModuleManager.BaseModule): _name = "DNS" - def __init__(self, bot, events, exports): - events.on("received.command.dns").hook(self.dns, min_args=1, - help="Get all addresses for a given hostname (IPv4/IPv6)", - usage="<hostname>") + @Utils.hook("received.command.dns", min_args=1, usage="<hostname>") def dns(self, event): + """ + Get all addresses for a given hostname (IPv4/IPv6) + """ hostname = event["args_split"][0] try: address_info = socket.getaddrinfo(hostname, 1, 0, |
