def connected(self, host, port): """connected Event This event is triggered by the underlying ``TCPClient`` Component when a successfully connection has been made. """ self.fire(NICK(self.nick)) self.fire(USER("circuits", "circuits", host, "Artbuddy IRC Bot by epicmuffin/bloodywing"))
def connected(self, host, port): """connected Event This event is triggered by the underlying ``TCPClient`` Component when a successfully connection has been made. """ self.fire(NICK("circuits")) self.fire(USER("circuits", "circuits", host, "Test circuits IRC Bot"))
def connected(self, host, port): print("Connected to %s:%d" % (host, port)) nick = self.nick hostname = 'wc3.wechall.net:61221' # hostname = gethostname() name = "%s!spacebot (%s)" % (nick, hostname) self.fire(NICK(nick)) self.fire(USER(nick, nick, hostname, name))
def test_registration(server, client, watcher): client.fire(NICK("test")) client.fire(USER("test", "localhost", server.host, "Test Client")) assert watcher.wait("numeric") assert client.expect( "numeric", [(u'localhost', None, None), 1, u"test", u"Welcome to the {0:s} IRC Network".format(server.network)])
def connected(self, host, port): """Connected Event. Triggered by the underlying tcpclient Component when a successfully connection has been made. """ self.fire(NICK(self.nick)) self.fire( USER(self.nick, self.nick, host, "Bot of Astonex or Softkitty"))
def connected(self, host, port): """connected Event This event is triggered by the underlying ``TCPClient`` Component when a successfully connection has been made. """ nick = self.nick hostname = self.hostname name = "%s on %s using circuits/%s" % (nick, hostname, systemVersion) self.fire(NICK(nick)) self.fire(USER(nick, hostname, host, name))
def connected(self, host, port): """Connected Event This event is triggered by the underlying ``TCPClient`` Component when a successfully connection has been made. """ nick = self.nick hostname = self.hostname name = "{0:s} on {1:s} using circuits/{2:s}".format( nick, hostname, circuits.__version__) self.fire(USER(nick, hostname, host, name)) self.fire(NICK(nick))
s = "test!foo@localhost" nick, ident, host = parseprefix(s) assert nick == "test" assert ident == "foo" assert host == "localhost" s = "test" nick, ident, host = parseprefix(s) assert nick == "test" assert ident is None assert host is None @pytest.mark.parametrize("event,data", [ (PASS("secret"), b"PASS secret\r\n"), (USER("foo", "localhost", "localhost", "Test Client"), b"USER foo localhost localhost :Test Client\r\n"), (NICK("test"), b"NICK test\r\n"), (PONG("localhost"), b"PONG :localhost\r\n"), (QUIT(), b"QUIT Leaving\r\n"), (QUIT("Test"), b"QUIT Test\r\n"), (QUIT("Test Message"), b"QUIT :Test Message\r\n"), (JOIN("#test"), b"JOIN #test\r\n"), (JOIN("#test", "secret"), b"JOIN #test secret\r\n"), (PART("#test"), b"PART #test\r\n"), (PRIVMSG("test", "Hello"), b"PRIVMSG test Hello\r\n"), (PRIVMSG("test", "Hello World"), b"PRIVMSG test :Hello World\r\n"), (NOTICE("test", "Hello"), b"NOTICE test Hello\r\n"), (NOTICE("test", "Hello World"), b"NOTICE test :Hello World\r\n"), (KICK("#test", "test"), b"KICK #test test :\r\n"), (KICK("#test", "test", "Bye"), b"KICK #test test Bye\r\n"), (KICK("#test", "test", "Good Bye!"), b"KICK #test test :Good Bye!\r\n"),
def connected(self, host, port): self.fire(NICK(self.nick)) self.fire(USER(self.nick, self.nick, host, self.realname))
nick, ident, host = parseprefix(s) assert nick == "test" assert ident == "foo" assert host == "localhost" s = "test" nick, ident, host = parseprefix(s) assert nick == "test" assert ident is None assert host is None @pytest.mark.parametrize("event,data", [ (PASS("secret"), b"PASS secret\r\n"), ( USER("foo", "localhost", "localhost", "Test Client"), b"USER foo localhost localhost :Test Client\r\n" ), (NICK("test"), b"NICK test\r\n"), (PONG("localhost"), b"PONG :localhost\r\n"), (QUIT(), b"QUIT Leaving\r\n"), (QUIT("Test"), b"QUIT Test\r\n"), (QUIT("Test Message"), b"QUIT :Test Message\r\n"), (JOIN("#test"), b"JOIN #test\r\n"), (JOIN("#test", "secret"), b"JOIN #test secret\r\n"), (PART("#test"), b"PART #test\r\n"), (PRIVMSG("test", "Hello"), b"PRIVMSG test Hello\r\n"), (PRIVMSG("test", "Hello World"), b"PRIVMSG test :Hello World\r\n"), (NOTICE("test", "Hello"), b"NOTICE test Hello\r\n"), (NOTICE("test", "Hello World"), b"NOTICE test :Hello World\r\n"), (KICK("#test", "test"), b"KICK #test test :\r\n"),