Facebook Messenger library for Python/Asyncio.
Project description
A powerful and efficient library to interact with Facebook’s Messenger, using just your email and password. This is an asyncio fork of the fbchat library.
This is not an official API, Facebook has that over here for chat bots. This library differs by using a normal Facebook account instead.
fbchat currently support:
Sending many types of messages, with files, stickers, mentions, etc.
Fetching all messages, threads and images in threads.
Searching for messages and threads.
Creating groups, setting the group emoji, changing nicknames, creating polls, etc.
Listening for, an reacting to messages and other events in real-time.
Type hints, and it has a modern codebase (e.g. only Python 3.5 and upwards).
async/await (COMING).
Essentially, everything you need to make an amazing Facebook bot!
Caveats
fbchat works by imitating what the browser does, and thereby tricking Facebook into thinking it’s accessing the website normally.
However, there’s a catch! Using this library may not comply with Facebook’s Terms Of Service!, so be responsible Facebook citizens! We are not responsible if your account gets banned!
Additionally, the APIs the library is calling is undocumented! In theory, this means that your code could break tomorrow, without the slightest warning! If this happens to you, please report it, so that we can fix it as soon as possible!
With that out of the way, you may go to Read The Docs to see the full documentation!
Installation
$ pip install fbchat-asyncio
If you don’t have pip, this guide can guide you through the process.
You can also install directly from source, provided you have pip>=19.0:
$ pip install git+https://github.com/tulir/fbchat-asyncio.git#egg=fbchat
Example Usage
import getpass
import fbchat
session = fbchat.Session.login("<email/phone number>", getpass.getpass())
user = fbchat.User(session=session, id=session.user_id)
user.send_text("Test message!")
More examples are available here.
Maintainer
Tulir Asokan / @tulir
Acknowledgements
This project was originally inspired by facebook-chat-api.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fbchat-asyncio-0.6.21.tar.gz
.
File metadata
- Download URL: fbchat-asyncio-0.6.21.tar.gz
- Upload date:
- Size: 55.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.4.2 requests/2.22.0 setuptools/49.3.1 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d1881a80814ee0ffb51f9e7fddc9826268432c04050c915ae905ed924317304 |
|
MD5 | e88e2a8fa636d6ff84e0d16687b5db15 |
|
BLAKE2b-256 | 1009e2ebacd51d9f7bbe0d218520d9d4f6596f38f6f2803a35e1e7139a4135a6 |
File details
Details for the file fbchat_asyncio-0.6.21-py3-none-any.whl
.
File metadata
- Download URL: fbchat_asyncio-0.6.21-py3-none-any.whl
- Upload date:
- Size: 66.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.4.2 requests/2.22.0 setuptools/49.3.1 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7b2a3082efcc75887dbba8561c662bbbd3152a4326299ab5b22badcb59535f3 |
|
MD5 | 756b3e8efdfb04f1fcdfdeb60ef25463 |
|
BLAKE2b-256 | e540ce29c4364115f73b23955bf0d2291b679015095b18217e104412a8fa7330 |