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
1 Asked on August 19, 2020 by ashmoe
1 Asked on August 18, 2020 by ken-setoguchi
4 Asked on August 18, 2020 by ityka-bandta
0 Asked on August 17, 2020 by ggokturk
multiprocessing python python 3 x python multiprocessing python multithreading
0 Asked on August 17, 2020 by dannycranfield
2 Asked on August 16, 2020 by william
1 Asked on August 15, 2020 by abhijeet-vipat
1 Asked on August 15, 2020 by mendy
0 Asked on August 14, 2020 by alessandro
1 Asked on August 14, 2020 by rogiller
1 Asked on August 13, 2020 by danny
3 Asked on August 12, 2020 by adi-shukla
2 Asked on August 11, 2020 by kuwir-singh
1 Asked on August 11, 2020 by saran3h
0 Asked on August 10, 2020 by user12217822
2 Asked on August 9, 2020 by shiwee
1 Asked on August 8, 2020 by piethon
1 Asked on August 7, 2020 by victor-canoz
Get help from others!
Recent Questions
Recent Answers
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP