Create a gist now

Instantly share code, notes, and snippets.

@brunsgaard / Secret
Created May 25, 2014

What would you like to do?
from twisted.internet import reactor
from twisted.words.protocols import irc
from twisted.internet.protocol import ClientFactory
NICKNAME = 'the_username'
PASSWORD = 'password'
class Bot(irc.IRCClient):
nickname = NICKNAME
password = PASSWORD
def dataReceived(self, data):
irc.IRCClient.dataReceived(self, data)
def signedOn(self):
print("\033[91m\n\nYOLO, I was signed on to the server!!!\n\033[0m")
def connectionLost(self, reason):
irc.IRCClient.connectionLost(self, reason)
class BotFactory(ClientFactory):
protocol = Bot
if __name__ == "__main__":
reactor.connectTCP(SERVER, 6667, BotFactory())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment