A powerful Facebook Messenger API to interact with Facebook and Messenger.
Project description
fbchat-muqit Facebook & Messenger API
fbchat-muqit An Unofficial Asynchronous Facebook Messenger API designed to interact with Facebook and Messenger. As It is an Unofficial API we are not responsible if you get banned by Facebook. We recommend to use a dummy Facebook account. For more details check the Documentation.
[!Note] Bumped from version
1.1.31to1.2.0and version1.2.0is a rewrite version meaning the library has been fully rewritten and Major changes has been made. The API is now fully Documented and the usage examples are updated.
[!WARNING] Due to
end-to-endencryption sending messages to other Users is not supported anymore. You can send messages to Group Chat, Room Chat and to pages. See more You may still be able to send messages to another User if the that User account is inactive for many years becauseend-to-endencryption is not applied when sending message to those account unless the account is Opened again.
🛠️ Installation
You can install fbchat-muqit using pip:
pip install fbchat-muqit
For the latest development version:
pip install git+https://github.com/togashigreat/fbchat-muqit.git
📙 Documentation
The API is Documented. Read The Documentation.
🔧 Prerequisites
- Python 3.9+
- A Facebook account (It's safer to use old unused account)
- Facebook account cookies 🍪
📖 Usage Example
To login in Facebook you will need Facebook account cookies. Since login via email and password is no longer supported.
To get your Facebook account cookies. First login in your Facebook account and then add C3C Chrome extension in your browser. Open a your Facebook account in a browser tab and use this extension to get your account cookies. Copy the cookies and save them in a json file. We will use the cookies to interact with Facebook server. We will call this account Client account.
A basic example of How to use it.
from fbchat_muqit import Client, Message, EventType
client = Client(cookies_file_path="cookies.json")
@client.event
async def on_message(message: Message):
# To avoid spam check if sender_id is client's id or not
if message.sender_id != client.uid:
# echo the message
await client.send_message(message.text, message.thread_id)
client.run()
Save the code in file test.py and now run the code.
python3 test.py
If It logins succesfully then Use another Facebook account to create a messenger group and add both of the accounts to the group. Now, send message to the group and fbchat_muqit Client account will listen to all incoming messages and events. If everything works properly It should reply and react to the message sent by your other account with an emoji.
📄 License
This project is distributed under a dual-license model:
-
BSD-3-Clause License: Parts of the code are reused and adapted from the original fbchat library, licensed under the BSD-3-Clause License. See LICENSE-BSD for details.
-
GPL v3 License: New contributions and modifications by Muhammad MuQiT/togashigreat are licensed under the GPL v3.0 License. See LICENSE for details.
✉️Contact Me
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fbchat_muqit-1.2.1.tar.gz.
File metadata
- Download URL: fbchat_muqit-1.2.1.tar.gz
- Upload date:
- Size: 212.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d384b44270444210a632545db175d56e3e35e0a718fc6d1410846b2e92cdee7
|
|
| MD5 |
0734237a2c8a25b9c3713dd67c7af6bc
|
|
| BLAKE2b-256 |
692c69a6cc49bb244dac55e1df9107472147577a6a1e46f601b11a4bba08c770
|
Provenance
The following attestation bundles were made for fbchat_muqit-1.2.1.tar.gz:
Publisher:
python_publish.yml on togashigreat/fbchat-muqit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fbchat_muqit-1.2.1.tar.gz -
Subject digest:
3d384b44270444210a632545db175d56e3e35e0a718fc6d1410846b2e92cdee7 - Sigstore transparency entry: 708020225
- Sigstore integration time:
-
Permalink:
togashigreat/fbchat-muqit@9886daad9d853636a45d526159e857dd39600eec -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/togashigreat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_publish.yml@9886daad9d853636a45d526159e857dd39600eec -
Trigger Event:
release
-
Statement type:
File details
Details for the file fbchat_muqit-1.2.1-py3-none-any.whl.
File metadata
- Download URL: fbchat_muqit-1.2.1-py3-none-any.whl
- Upload date:
- Size: 108.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32fcb6a3d595365d6f6521234fcc82969d6fa65b419547530819a44de9624e57
|
|
| MD5 |
88d9ba8b2d8d844801c420d9fa6535fb
|
|
| BLAKE2b-256 |
bdbfe4c4d3a08a99f26dd1e11624ebacc2c79347d6702280610293e6206987ff
|
Provenance
The following attestation bundles were made for fbchat_muqit-1.2.1-py3-none-any.whl:
Publisher:
python_publish.yml on togashigreat/fbchat-muqit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fbchat_muqit-1.2.1-py3-none-any.whl -
Subject digest:
32fcb6a3d595365d6f6521234fcc82969d6fa65b419547530819a44de9624e57 - Sigstore transparency entry: 708020230
- Sigstore integration time:
-
Permalink:
togashigreat/fbchat-muqit@9886daad9d853636a45d526159e857dd39600eec -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/togashigreat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_publish.yml@9886daad9d853636a45d526159e857dd39600eec -
Trigger Event:
release
-
Statement type: