X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/a62d0d18bbb5926d22df18db5eba53eb21a10817..caa333c30efb9a405e64766460aee88edcb089bf:/modules/resources.py diff --git a/modules/resources.py b/modules/resources.py index 016e4bd..e5b7de1 100644 --- a/modules/resources.py +++ b/modules/resources.py @@ -6,7 +6,7 @@ modinfo = { 'author': 'Erebus Team', 'license': 'public domain', - 'compatible': [1,2], + 'compatible': [0], 'depends': [], 'softdeps': ['help'], } @@ -20,10 +20,10 @@ modstop = lib.modstop # module code import resource -@lib.hook(needchan=False, glevel=lib.MANAGER) +@lib.hook(needchan=False, wantchan=True, glevel=lib.MANAGER) @lib.help(None, "show RAM usage") def ram(bot, user, chan, realtarget, *args): - if chan is not None and realtarget == chan.name: replyto = chan + if chan is not None: replyto = chan else: replyto = user try: @@ -33,10 +33,10 @@ def ram(bot, user, chan, realtarget, *args): bot.fastmsg(replyto, "Memory usage (MiB): %r" % (res.ru_maxrss/1024.0)) -@lib.hook(needchan=False, glevel=lib.MANAGER) +@lib.hook(needchan=False, wantchan=True, glevel=lib.MANAGER) @lib.help(None, "show resource usage") def resources(bot, user, chan, realtarget, *args): - if chan is not None and realtarget == chan.name: replyto = chan + if chan is not None: replyto = chan else: replyto = user try: