Skip to content

Instantly share code, notes, and snippets.

@edk0
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edk0/a9c624f45e871bed444b to your computer and use it in GitHub Desktop.
Save edk0/a9c624f45e871bed444b to your computer and use it in GitHub Desktop.
(lambda t,d,r,i,s:(lambda s:(s.connect(('irc.rozznet.net',6667)),s.send('USER '
+'h h h h%sNICK hhh'%d+d),[(t.__setitem__(slice(None),a[1]),[s.send(y(*r.match(
x,a[0]).groups())+d)for x,y in{'PI(NG.*)':'PO'.__add__,':.*? (PRIVMSG .*? :)!('
+'.*)':lambda c,m:(lambda x:x and c+x or'')({'die':4,'hello':'hay bby','cocks':
'lol dongs'}.get(str(m).lower(),0)),':.*? 002':'JOIN #test'.strip}.items()if r.
match(x,a[0])])for a in(t.extend(s.recv(3))or t.split(d)for n in i.count())if a
[1:]]))(s.socket()))(bytearray(),'\r\n',*map(__import__,['re','itertools',
'socket']))
@cousteaulecommandant
Copy link

Rewritten version with only 7 lines I wrote this morning instead of working:

(lambda t,d,r,i,s:(lambda s,r=r.match:(s.connect(('irc.rozznet.net',6667)),s.
send('USER h h h h%sNICK hhh'%d+d),[(t.__setitem__(slice(None),a[1]),[s.send(y(
*r(x,a[0]).groups())+d)for x,y in((':.*? 002','JOIN #test'.strip),('PI(NG.*)',
'PO'.__add__),(':.*? (PRIVMSG .*? :)!(.*)',lambda c,m:(lambda x:x and c+x or'')
({'die':4,'hello':'hay bby','cocks':'lol dongs'}.get(str(m).lower(),0))))if r(x
,a[0])])for a in(t.extend(s.recv(3))or t.split(d)for n in i.count())if a[1:]]))
(s.socket()))(bytearray(),'\r\n',*map(__import__,['re','itertools','socket']))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment