Skip to content

afonsocarlos/fbchat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fbchat

Facebook Chat (Messenger) for Python. This project was inspired by facebook-chat-api.

No XMPP or API key is needed. Just use your ID and PASSWORD.

Installation

Simple:

$ pip install fbchat

Example

import fbchat

client = fbchat.Client("YOUR_ID", "YOUR_PASSWORD")

Sending a Message

friends = client.getUsers("FRIEND'S NAME")  # return a list of names
friend = friends[0]
sent = client.send(friend.uid, "Your Message")
if sent:
    print("Message sent successfully!")

Getting last messages sent

last_messages = client.getThreadInfo(friend.uid,0)
last_messages.reverse()  # messages come in reversed order

for message in last_messages:
    print(message.body)

Authors

Taehoon Kim / @carpedm20

About

Facebook Chat (Messenger) for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%