-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFbChat.py
More file actions
33 lines (24 loc) · 767 Bytes
/
FbChat.py
File metadata and controls
33 lines (24 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from fbchat import Client
from fbchat.models import *
class FbChat:
email = ""
password = ""
idChat = ""
client = None
def __init__(self, email, password, idChat=None):
self.email = email
self.password = password
self.idChat = idChat
self.conectar()
def conectar(self):
self.client = Client(self.email, self.password)
def setEmail(self, email):
self.email = email
def setIdChat(self, idChat):
self.idChat = idChat
def setPassword(self, password):
self.password = password
def sendMessageToPerson(self, msg):
self.client.send(Message(text=msg), thread_id=self.idChat, thread_type=ThreadType.USER)
def close(self):
self.client.logout()