Skip to main content

Facebook Messenger library for Python/Asyncio.

Project description

Project version Supported python versions: 3.6, 3.7 and 3.8 License: BSD 3-Clause

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

Acknowledgements

This project was originally inspired by facebook-chat-api.

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

fbchat-asyncio-0.6.21.tar.gz (55.4 kB view details)

Uploaded Source

Built Distribution

fbchat_asyncio-0.6.21-py3-none-any.whl (66.4 kB view details)

Uploaded Python 3

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

Hashes for fbchat-asyncio-0.6.21.tar.gz
Algorithm Hash digest
SHA256 5d1881a80814ee0ffb51f9e7fddc9826268432c04050c915ae905ed924317304
MD5 e88e2a8fa636d6ff84e0d16687b5db15
BLAKE2b-256 1009e2ebacd51d9f7bbe0d218520d9d4f6596f38f6f2803a35e1e7139a4135a6

See more details on using hashes here.

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

Hashes for fbchat_asyncio-0.6.21-py3-none-any.whl
Algorithm Hash digest
SHA256 c7b2a3082efcc75887dbba8561c662bbbd3152a4326299ab5b22badcb59535f3
MD5 756b3e8efdfb04f1fcdfdeb60ef25463
BLAKE2b-256 e540ce29c4364115f73b23955bf0d2291b679015095b18217e104412a8fa7330

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page