Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

class Bot:
def __init__(self):
self._messageCount = 0
self.commandList = {}

self.config = {
Expand All @@ -19,14 +20,13 @@ def __init__(self):
self.permissions = {

"tuckismad": 3,
"TyrantWarship": 1
"TyrantWarship": 1,
"hcwool": 2
}

self.timedEvents = {
'livestreamChecker': [self.CheckLiveStreams, time(), 10],
'hangoutsAnnoucenment': [
lambda:
self.Send(self.channel, "24/7 Hangouts room, check it out here! http://goo.gl/HkFFqg"), time(), 3600]
'hangoutsAnnoucenment': [self.HangoutsNotify, time(), 3600]
}

self.host = "irc.freenode.net"
Expand All @@ -47,6 +47,11 @@ def __init__(self):

self.AddModules()

def HangoutsNotify(self):
if self._messageCount > 10:
self.Send(self.channel, "24/7 Hangouts room, check it out here! http://goo.gl/HkFFqg")
self._messageCount = 0

def Send(self, target, message):
'''
Send(String target, String message)
Expand Down Expand Up @@ -130,6 +135,7 @@ def Run(self):
while True:
try:
data = self.irc.recv(4096).decode("UTF-8", "replace")
self._messageCount += 1
except:
pass
if(data.find("PING") != -1):
Expand Down