Ja používam Python Topánok Builder rámec a som testovanie na emulátor. Teraz už viem, že môj adaptívne karty JSON súbor je ideálne, pretože je to výstavnú všetky údaje, ako som túžil na oboch VisualStudio Kód a https://adaptivecards.io/designer/. Avšak, keď som spustiť emulátor moje adaptívne je úplne prázdny.
Teraz kód používam na moje adaptívne karty je:
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 )
Potom som spustiť pomocou:
FlightDetailCard = self.adaptive_flight_card_attachment()
response = MessageFactory.attachment(FlightDetailCard)
await turn_context.send_activity(response)
Niekde tu som urobiť chybu a ja nedokážem zaostriť kde. Tak môže mi niekto prosím, pomôžte mi tu?