Skip to content

Instantly share code, notes, and snippets.

@proxypoke proxypoke/bernd.py
Last active Dec 11, 2015

Embed
What would you like to do?
#!/usr/bin/python
import blackbox
import re
ach = re.compile("(\s+|^)ach\s+[^\s]+\s*", re.I)
def main():
irc = blackbox.IRC(ssl=True)
irc.connect("irc.hackint.eu", 6697)
irc.nickname("Bernd")
irc.username("Bernd", "Bernd Lauert")
parser = blackbox.Parser()
while True:
data = irc.recv()
print(data)
event = parser.parse(data)
if event.command == "376": # End of MOTD
break
irc.join("#raumzeitlabor")
while True:
data = irc.recv(4096)
event = parser.parse(data)
print(event)
if event.command == "PRIVMSG":
print(event.params)
if ach.search(event.params[1]):
irc.say(event.params[0], "Ach " + event.origin()[1:] + ".")
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.