summaryrefslogtreecommitdiff
path: root/librespeech.py
diff options
context:
space:
mode:
Diffstat (limited to 'librespeech.py')
-rwxr-xr-xlibrespeech.py72
1 files changed, 32 insertions, 40 deletions
diff --git a/librespeech.py b/librespeech.py
index 7da041d..ab37e89 100755
--- a/librespeech.py
+++ b/librespeech.py
@@ -29,7 +29,7 @@ assert miniirc.ver >= (1, 4, 0), "This bot requires miniirc >= v1.4.0."
# Variables
nick = "lbsp"
-haxxorname = "qeeg"
+haxxorname = ["qeeg"]
ident = nick
realname = "Censorship"
identity = None
@@ -89,6 +89,7 @@ def yay(irc, hostmask, args):
t = text.lower()
if args[1] != irc.current_nick:
return
+ irc.msg("ChanServ", "DEOP", channel, haxxorname[0])
irc.msg(
"ChanServ",
"UNBAN",
@@ -96,39 +97,27 @@ def yay(irc, hostmask, args):
)
irc.send("JOIN", channel)
if not defcon[0]: return
- if hostmask[0] != haxxorname:
+ if hostmask[0] != haxxorname[0]:
return
- irc.msg("ChanServ", "DEOP", channel, haxxorname)
- irc.send("KICK", channel, haxxorname, "retaliation")
- time.sleep(3)
- irc.msg(
- "ChanServ",
- "UNBAN",
- channel
- )
- irc.send("JOIN", channel)
- if not defcon[0]: return
- if hostmask[0] != haxxorname:
- return
- irc.msg("ChanServ", "DEOP", channel, haxxorname)
- irc.send("KICK", channel, haxxorname, "retaliation")
+ irc.msg("ChanServ", "DEOP", channel, haxxorname[0])
+ irc.send("KICK", channel, haxxorname[0], "retaliation")
@irc.Handler("JOIN", colon=False)
def yay(irc, hostmask, args):
channel = args[0]
if hostmask[0] == irc.current_nick:
- if defcon[0]: irc.msg("ChanServ", "DEOP", channel, haxxorname)
+ if defcon[0]: irc.msg("ChanServ", "DEOP", channel, haxxorname[0])
irc.msg("ChanServ", "OP", channel)
elif not defcon[0]: return
- elif hostmask[0] == haxxorname:
+ elif hostmask[0] == haxxorname[0]:
if defcon[0] == 1:
- irc.notice(haxxorname, f"[{channel}] You are not allowed to op up, change the topic, set modes, or do any similar thing in this channel.")
+ irc.notice(haxxorname[0], f"[{channel}] You are not allowed to op up, change the topic, set modes, or do any similar thing in this channel.")
if defcon[0] == 3:
- irc.send("MODE", channel, "+q", "$a:%s" % haxxorname)
+ irc.send("MODE", channel, "+q", "$a:%s" % haxxorname[0])
if defcon[0] >= 4:
- irc.send("MODE", channel, "+b", "$a:%s" % haxxorname)
- irc.send("KICK", channel, haxxorname, "You're banned!")
+ irc.send("MODE", channel, "+b", "$a:%s" % haxxorname[0])
+ irc.send("KICK", channel, haxxorname[0], "You're banned!")
else:
- irc.notice(hostmask[0], f"[{channel}] Welcome to the channel! Please keep an eye on {haxxorname} to make sure they don't do anything evil.")
+ irc.notice(hostmask[0], f"[{channel}] Welcome to the channel! Please keep an eye on {haxxorname[0]} to make sure they don't do anything evil.")
@irc.Handler("PRIVMSG", colon=False)
def yay(irc, hostmask, args):
badwords = open("bw.txt").read().strip().split("\n")
@@ -137,33 +126,38 @@ def yay(irc, hostmask, args):
text = args[-1].lower().strip()
for each in badwords.lower():
if each in text or ' ' + each + ' ' in text or text.startswith(each + " ") or text.endswith(" " + each) or text == each:
- irc.send("MODE", channel, "+q", "$a:%s" % haxxorname)
+ irc.send("MODE", channel, "+q", "$a:%s" % haxxorname[0])
time.sleep(60)
- irc.send("MODE", channel, "-q", "$a:%s" % haxxorname)
+ irc.send("MODE", channel, "-q", "$a:%s" % haxxorname[0])
return
+ elif args[-1].startswith(f"{irc.current_nick}:") and hostmask[0] == haxxorname[0]:
+ irc.msg(channel, f"{hostmask[0]}: no")
elif hostmask[0] in owner and args[-1].startswith(f"{irc.current_nick}: "):
lat = args[-1].split(" ")[1:]
if lat[0] == f"quit":
exit(0)
+ elif lat[0] == f"target":
+ haxxorname[0] = lat[1]
+ irc.msg(channel, f"{hostmask[0]}: set target to {haxxorname[0]}")
elif lat[0] == f"off":
defcon[0] = 0
- irc.send("MODE", channel, "-bq", "$a:%s" % haxxorname, "$a:%s" % haxxorname)
+ irc.send("MODE", channel, "-bq", "$a:%s" % haxxorname[0], "$a:%s" % haxxorname[0])
irc.msg(channel, f"{hostmask[0]}: defcon 0 set: relax")
elif lat[0] == f"noop":
defcon[0] = 1
- irc.send("MODE", channel, "-bqo", "$a:%s" % haxxorname, "$a:%s" % haxxorname, haxxorname)
+ irc.send("MODE", channel, "-bqo", "$a:%s" % haxxorname[0], "$a:%s" % haxxorname[0], haxxorname[0])
irc.msg(channel, f"{hostmask[0]}: defcon 1 set: deny channel operator privileges")
elif lat[0] == f"censor":
defcon[0] = 2
- irc.send("MODE", channel, "-bq", "$a:%s" % haxxorname, "$a:%s" % haxxorname)
+ irc.send("MODE", channel, "-bq", "$a:%s" % haxxorname[0], "$a:%s" % haxxorname[0])
irc.msg(channel, f"{hostmask[0]}: defcon 2 set: temporary quiet on badwords")
elif lat[0] == f"quiet":
defcon[0] = 3
- irc.send("MODE", channel, "-b+q", "$a:%s" % haxxorname, "$a:%s" % haxxorname)
+ irc.send("MODE", channel, "-b+q", "$a:%s" % haxxorname[0], "$a:%s" % haxxorname[0])
irc.msg(channel, f"{hostmask[0]}: defcon 3 set: quiet")
elif lat[0] == f"ban":
defcon[0] = 4
- irc.send("MODE", channel, "+bq", "$a:%s" % haxxorname, "$a:%s" % haxxorname)
+ irc.send("MODE", channel, "+bq", "$a:%s" % haxxorname[0], "$a:%s" % haxxorname[0])
irc.msg(channel, f"{hostmask[0]}: defcon 4 set: automatic kickban")
elif lat[0] == f"badword":
if lat[1] != "list" and len(lat) < 3 or len(lat) > 3:
@@ -180,9 +174,7 @@ def yay(irc, hostmask, args):
if lat[1] == "add" or lat[1] == "del":
irc.msg(channel, f"{hostmask[0]}: " + badword(action, lat[2]))
else:
- irc.msg(channel, f"{hostmask[0]}: usage: {irc.current_nick} (off | noop | censor | quiet | ban | badword)")
- elif args[-1].startswith(f"{irc.current_nick}:") and hostmask[0] == haxxorname:
- irc.msg(channel, f"{hostmask[0]}: lmao u serious?")
+ irc.msg(channel, f"{hostmask[0]}: usage: {irc.current_nick} (off | noop | censor | quiet | ban | ducks | badword | target)")
elif args[-1].startswith(f"{irc.current_nick}:"):
irc.msg(channel, f"{hostmask[0]}: unauthorized")
@@ -193,12 +185,12 @@ def yay(irc, hostmask, args):
channel = args[0]
if args[1] == "-o" and args[2] == irc.current_nick:
irc.msg("ChanServ", "OP", channel)
- if args[1] == "+o" and args[2] == haxxorname:
- irc.msg("ChanServ", "DEOP", channel, haxxorname)
- if hostmask[0] != haxxorname:
+ if args[1] == "+o" and args[2] == haxxorname[0]:
+ irc.msg("ChanServ", "DEOP", channel, haxxorname[0])
+ if hostmask[0] != haxxorname[0]:
return
irc.msg("ChanServ", "OP", channel)
- irc.msg("ChanServ", "DEOP", channel, haxxorname)
+ irc.msg("ChanServ", "DEOP", channel, haxxorname[0])
irc.send("MODE", channel, ''.join([trans(s) for s in args[1]]), *(args[2:]))
@irc.Handler("TOPIC", colon=False)
def yay(irc, hostmask, args):
@@ -206,10 +198,10 @@ def yay(irc, hostmask, args):
channel = args[0]
text = args[-1]
t = text.lower()
- if hostmask[0] != haxxorname:
+ if hostmask[0] != haxxorname[0]:
topic[0] = text
return
- irc.msg("ChanServ", "DEOP", channel, haxxorname)
+ irc.msg("ChanServ", "DEOP", channel, haxxorname[0])
irc.send(
"TOPIC",
channel,
@@ -219,7 +211,7 @@ def yay(irc, hostmask, args):
def yay(irc, hostmask, args):
channel = args[0]
if defcon[0]:
- irc.msg("ChanServ", "DEOP", channel, haxxorname)
+ irc.msg("ChanServ", "DEOP", channel, haxxorname[0])
irc.msg(
"ChanServ",
"UNBAN",