Add message when unauthorized user attempts to use admin commands

This allows me to differentiate between when a user isn't authorized and when the plugin errors.
This commit is contained in:
Robert Miles 2020-02-25 14:08:31 -05:00
parent b31b30c48f
commit 8573ac295d
1 changed files with 4 additions and 1 deletions

View File

@ -5,7 +5,9 @@ BOT = None
def admin(event):
if BOT is None: return
if event.hostmask not in ADMIN_HOSTMASKS: return
if event.hostmask not in ADMIN_HOSTMASKS:
BOT.socket.send(IRCLine("PRIVMSG","#meta","You're not the boss of me! (hostmask {!s})".format(event.hostmask)).line)
return
if len(event.parts)==0: return
if event.parts[0]=="reload":
BOT.load_modules()
@ -30,6 +32,7 @@ def on_invite(event):
PASSWORD="whoops"
try:
with open(".password") as f: PASSWORD=f.read().strip()
except: pass
def login(event):
BOT.socket.send(IRCLine("NS","IDENTIFY",PASSWORD).line)