Skip to content

@brunsgaard /test.py secret
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
from twisted.internet import reactor
from twisted.words.protocols import irc
from twisted.internet.protocol import ClientFactory
SERVER = "irc.freenode.net"
NICKNAME = 'the_username'
PASSWORD = 'password'
class Bot(irc.IRCClient):
nickname = NICKNAME
password = PASSWORD
def dataReceived(self, data):
print(data)
irc.IRCClient.dataReceived(self, data)
def signedOn(self):
print("\033[91m\n\nYOLO, I was signed on to the server!!!\n\033[0m")
self.quit()
def connectionLost(self, reason):
irc.IRCClient.connectionLost(self, reason)
reactor.stop()
class BotFactory(ClientFactory):
protocol = Bot
if __name__ == "__main__":
reactor.connectTCP(SERVER, 6667, BotFactory())
reactor.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.