diff --git a/plugins/mute.py b/plugins/mute.py new file mode 100644 index 0000000..15dc80b --- /dev/null +++ b/plugins/mute.py @@ -0,0 +1,39 @@ +""" +from util import hook + +@hook.sieve +def mutesieve(bot, input, func, kind, args): + if kind == "event": + return input + if input.chan : + if input.command == "PRIVMSG" and input.lastparam[1:] == "unmute": + return input + else: + return None + return input + +@hook.command +def mute(inp, input=None, db=None): + ".mute -- Mutes the bot in . If no channel is specified, it is muted in the current channel." + if inp: + input.chan = inp + if input.nick in input.bot.config["admins"]: + + input.notice("Muted") + else: + input.notice("Only bot admins can use this command!") + +@hook.command +def unmute(inp, input=None, db=None): + ".unmute -- Unmutes the bot in . If no channel is specified, it is unmuted in the current channel." + if inp: + input.chan = inp + if input.nick in input.bot.config["admins"]: + if : + input.notice("Already muted!") + else: + + input.notice("Muted") + else: + input.notice("Only bot admins can use this command!") +"""