<commit_before>from twisted.words.protocols import irc
from twisted.internet import reactor, protocol

import time, sys

from sqlalchemy import create_engine

class IAMABot(irc.IRCClient):
	
	sovereign = Sovereign("Sovereign_Beta")

	engine = create_engine('sqlite:///:memory:', echo=True)

	def connectionMade(self):
		irc.IRCClient.connectionMade(self)
		

	def connectionLost(self, reason):
		irc.IRCClient.connectionLost(self, reason)
		
	def privmsg(self, user, channel, msg):
		nick = user.split('!',1)[0]

		if (msg == "@hello"):


	<commit_msg>Bot can connect to server<commit_after>from twisted.words.protocols import irc
from twisted.internet import reactor, protocol
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from orders import *

class IAMABot(irc.IRCClient):
	def __init__(self):
		engine = create_engine('sqlite:///bot.db')
		Session = sessionmaker(bind=engine)
		
		self.session = Session()
		self.sovereign = self.session.query(Sovereign).first()
		self.nickname = self.sovereign.nickname.encode()

	def signedOn(self):
		for chan in self.sovereign.ircchannels:
			self.join(chan.name.encode(), chan.key.encode())

	def privmsg(self, user, channel, msg):
		nick = user.split('!',1)[0]

class SovereignFactory(protocol.ClientFactory):
	def buildProtocol(self, addr):
		bot = IAMABot()
		bot.factory = self
		return bot

if __name__ == '__main__':
	sovereign = SovereignFactory()
	reactor.connectTCP("irc.rizon.net", 6667, ssovereign)
	reactor.run()
{'fraction_non_alphanumeric': 0.12483311081441922, 'fraction_numerical': 0.0053404539385847796, 'mean_word_length': 5.194214876033058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3235509', 'n_tokens_mistral': 555, 'n_tokens_neox': 492, 'n_words': 114}