Stack Overflow Asked on January 3, 2022
I tried to deployed a chatbot which involves the application of MongoDB but I am stuck by this bug all day (figure 1). I cannot what is wrong because I follow the doc strictly and check the config vars over and over again to make sure all of them are correct. Can anyone give me some suggestions? I just ran out of options. Here is a snippet of codes:
ACCESS_TOKEN = os.environ['ACCESS_TOKEN']
VERIFY_TOKEN = os.environ['VERIFY_TOKEN']
MONGODB_URI = os.environ['MONGODB_URI']
db = MongoClient(MONGODB_URI).get_database()
collection = db.get_collection('QnA')
time = datetime.fromtimestamp(int(str(message['timestamp'])[:-3])).strftime(
'%Y-%m-%d %H:%M:%S')
collection.insert_one({"question": message['message'].get('text'),
"answer": response, 'time': time})
It turned out to be just a stupid question because of my carelessness. The data is not authenticated to be inserted until I add the IP of facebook messenger into the whitelist of my project. This can be referred to this link.
Answered by Memphis Meng on January 3, 2022
2 Asked on January 3, 2021 by user14289862
4 Asked on January 3, 2021 by tower
1 Asked on January 2, 2021 by the-rais
0 Asked on January 2, 2021 by edgaras-karka
0 Asked on January 2, 2021 by ayusch-jain
1 Asked on January 2, 2021 by aff
1 Asked on January 2, 2021 by rob-n
1 Asked on January 2, 2021 by sudarshan-mane
3 Asked on January 2, 2021 by user2622016
2 Asked on January 2, 2021 by kos
3 Asked on January 2, 2021 by matias-andina
2 Asked on January 1, 2021 by myz
3 Asked on January 1, 2021 by theo-jedi
Get help from others!
Recent Answers
Recent Questions
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir