This is a program i wrote in 2020, which allows integration of Python script into Facebook Messenger app.
Code requires access token, which can be obtained from Facebook developers website, a Facebook page, which will serve as intermediary between you and the Python script, since you will be writing messages to this Page on the messenger.
lastly you need ngrok, and you will have to provide Facebook with callback URL, which is provided by Ngrok.