Throttle channel joins
parent
c65639d55f
commit
6198b30d76
4
irc.py
4
irc.py
|
@ -46,7 +46,7 @@ class Bot(asynchat.async_chat):
|
||||||
# asynchat.async_chat.push(self, *args, **kargs)
|
# asynchat.async_chat.push(self, *args, **kargs)
|
||||||
|
|
||||||
def __write(self, args, text=None):
|
def __write(self, args, text=None):
|
||||||
# print '%r %r %r' % (self, args, text)
|
# print 'PUSH: %r %r %r' % (self, args, text)
|
||||||
try:
|
try:
|
||||||
if text is not None:
|
if text is not None:
|
||||||
# 510 because CR and LF count too, as nyuszika7h points out
|
# 510 because CR and LF count too, as nyuszika7h points out
|
||||||
|
@ -102,7 +102,7 @@ class Bot(asynchat.async_chat):
|
||||||
line = line[:-1]
|
line = line[:-1]
|
||||||
self.buffer = ''
|
self.buffer = ''
|
||||||
|
|
||||||
# print line
|
# print 'GOT:', repr(line)
|
||||||
if line.startswith(':'):
|
if line.startswith(':'):
|
||||||
source, line = line[1:].split(' ', 1)
|
source, line = line[1:].split(' ', 1)
|
||||||
else: source = None
|
else: source = None
|
||||||
|
|
|
@ -43,7 +43,9 @@ def service(phenny, input, command, args):
|
||||||
lines = bytes.splitlines()
|
lines = bytes.splitlines()
|
||||||
if not lines:
|
if not lines:
|
||||||
return phenny.reply("Sorry, the service didn't respond any output.")
|
return phenny.reply("Sorry, the service didn't respond any output.")
|
||||||
phenny.say(lines[0][:350])
|
try: line = lines[0].encode('utf-8')[:350]
|
||||||
|
except: line = lines[0][:250]
|
||||||
|
phenny.say(line)
|
||||||
|
|
||||||
def refresh(phenny):
|
def refresh(phenny):
|
||||||
if hasattr(phenny.config, 'services'):
|
if hasattr(phenny.config, 'services'):
|
||||||
|
|
|
@ -53,16 +53,19 @@ def setup(phenny):
|
||||||
phenny.handle_connect = outer_handle_connect
|
phenny.handle_connect = outer_handle_connect
|
||||||
|
|
||||||
def startup(phenny, input):
|
def startup(phenny, input):
|
||||||
|
import time
|
||||||
|
|
||||||
if hasattr(phenny.config, 'serverpass'):
|
if hasattr(phenny.config, 'serverpass'):
|
||||||
phenny.write(('PASS', phenny.config.serverpass))
|
phenny.write(('PASS', phenny.config.serverpass))
|
||||||
|
|
||||||
if hasattr(phenny.config, 'password'):
|
if hasattr(phenny.config, 'password'):
|
||||||
phenny.msg('NickServ', 'IDENTIFY %s' % phenny.config.password)
|
phenny.msg('NickServ', 'IDENTIFY %s' % phenny.config.password)
|
||||||
__import__('time').sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
# Cf. http://swhack.com/logs/2005-12-05#T19-32-36
|
# Cf. http://swhack.com/logs/2005-12-05#T19-32-36
|
||||||
for channel in phenny.channels:
|
for channel in phenny.channels:
|
||||||
phenny.write(('JOIN', channel))
|
phenny.write(('JOIN', channel))
|
||||||
|
time.sleep(0.5)
|
||||||
startup.rule = r'(.*)'
|
startup.rule = r'(.*)'
|
||||||
startup.event = '251'
|
startup.event = '251'
|
||||||
startup.priority = 'low'
|
startup.priority = 'low'
|
||||||
|
|
Loading…
Reference in New Issue