|
@@ -4,14 +4,15 @@ from datetime import datetime
|
|
|
|
|
|
#Основной класс бота
|
|
|
class JabberBot:
|
|
|
- def __init__(self, jid, password):
|
|
|
+ def __init__(self, jid, password, port):
|
|
|
jid = xmpp.JID(jid)
|
|
|
- self.user, self.server, self.password = jid.getNode(), jid.getDomain(), password
|
|
|
+ self.user, self.server, self.password, self.port = jid.getNode(), jid.getDomain(), password, port
|
|
|
self.connect()
|
|
|
self.auth()
|
|
|
+
|
|
|
#Метод проверки подключения к серверу xmpp
|
|
|
def connect(self):
|
|
|
- self.conn = xmpp.Client(self.server, debug = [])
|
|
|
+ self.conn = xmpp.Client(self.server, self.port,debug = [])
|
|
|
conn_result = self.conn.connect()
|
|
|
if not conn_result:
|
|
|
print("Can't connect to server!\n")
|