Skip to content

Latest commit

 

History

History
109 lines (63 loc) · 3.16 KB

README.md

File metadata and controls

109 lines (63 loc) · 3.16 KB

babel

Songmam

a facebook messenger hypermodern python library based on fastapi.

Build status Python Version Dependencies Status

Code style: black Security: bandit Pre-commit Semantic Versions License

Features

Installation

pip install songmam

Documentation

WIP

Usage/Examples

There are a few examples under the folder, examples

from fastapi import FastAPI

from songmam import WebhookHandler, MessengerApi
from songmam.models.webhook import MessagesEvent

app = FastAPI(
    title="echo"
)


handler = WebhookHandler(
    app=app, path="/webhook", app_secret=FACEBOOK_APP_SECRET, verify_token=FACEBOOK_PAGE_VERIFY_TOKEN
)

api = MessengerApi(access_token=FACEBOOK_PAGE_ACCESS_TOKEN)


@handler.add(MessagesEvent)
async def handle_message(event: MessagesEvent, *args, **kwargs):
    """
    echo back message
    """
    await api.send(event.theMessaging.sender, event.theMessaging.message.text)

Used By

This project is used by the following companies:

Authors

Feedback

If you have any feedback, you can create an issue or PR.

🛡 License

License

This project is licensed under the terms of the MIT license. See LICENSE for more details.

Credits

This project was generated with python-package-template.