invokeSync method
call api latest Tdlib-Methods example:
tg.invokeSync(
"parseTextEntities",
parameters: {
"parse_mode": {
"@type": "textParseModeHTML",
},
"text": text
},
clientId: tg.client_id,
);
Implementation
Map invokeSync({
required Map parameters,
bool isThrowOnError = true,
}) {
Map result = td_execute(parameters);
if (result["@type"] == "error") {
if (!isThrowOnError) {
return result;
}
result["invoke_request"] = parameters;
throw result;
}
return result;
}