Sto usando Python Bot Generatore quadro e sto provando sull'emulatore. Ora so che il mio adaptive scheda di file JSON è perfetto perché è di mostrare tutti i dati come ho desiderato sia VisualStudio Codice e https://adaptivecards.io/designer/. Però quando avvio l'emulatore mio adattamento è completamente vuoto.
Ora il codice che sto usando per il mio adaptive scheda:
def adaptive_flight_card_attachment(self):
JSONFileName = 'QuickAdaptiveJSONfile.json'
file_path = "AdaptiveFlightCardFile"
if os.path.exists(file_path):
files_in_dir = os.listdir(file_path)
if JSONFileName in files_in_dir:
file_path = os.getcwd()+f'/{file_path}'+f'/{JSONFileName}'
with open(file_path, "r+", encoding="unicode_escape") as in_file:
card = json.load(in_file)
return Attachment(content_type="application/vnd.microsoft.card.adaptive", content=card )
Ho quindi eseguito utilizzando:
FlightDetailCard = self.adaptive_flight_card_attachment()
response = MessageFactory.attachment(FlightDetailCard)
await turn_context.send_activity(response)
Da qualche parte mi sbaglio e non riesco a perno punto in cui. Così qualcuno può per favore aiutarmi?