More improvements

This commit is contained in:
Daniil Gentili 2020-10-06 18:03:36 +02:00
parent 1d16cf807b
commit 14d14fdc3c
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -117,7 +117,7 @@ trait Start
$this->gettingApiId = false;
return $app;
}
yield from $this->webAPIEcho(Lang::$current_lang['apiParamsError']);
yield $this->webAPIEcho(Lang::$current_lang['apiParamsError']);
}
return null;
}
@ -128,7 +128,7 @@ trait Start
yield from $this->myTelegramOrgWrapper->login($_POST['phone_number']);
yield $this->webAPIEcho();
} catch (\Throwable $e) {
yield from $this->webAPIEcho(\sprintf(Lang::$current_lang['apiError'], $e->getMessage()));
yield $this->webAPIEcho(\sprintf(Lang::$current_lang['apiError'], $e->getMessage()));
}
}
private function webAPICompleteLogin(): \Generator
@ -136,9 +136,9 @@ trait Start
try {
yield from $this->myTelegramOrgWrapper->completeLogin($_POST['code']);
} catch (\danog\MadelineProto\RPCErrorException $e) {
yield from $this->webAPIEcho(\sprintf(Lang::$current_lang['apiError'], $e->getMessage()));
yield $this->webAPIEcho(\sprintf(Lang::$current_lang['apiError'], $e->getMessage()));
} catch (\danog\MadelineProto\Exception $e) {
yield from $this->webAPIEcho(\sprintf(Lang::$current_lang['apiError'], $e->getMessage()));
yield $this->webAPIEcho(\sprintf(Lang::$current_lang['apiError'], $e->getMessage()));
}
}
private function webAPICreateApp(): \Generator
@ -149,9 +149,9 @@ trait Start
$app = (yield from $this->myTelegramOrgWrapper->createApp($params));
return $app;
} catch (\danog\MadelineProto\RPCErrorException $e) {
yield from $this->webAPIEcho(\sprintf(Lang::$current_lang['apiError'], $e->getMessage()));
yield $this->webAPIEcho(\sprintf(Lang::$current_lang['apiError'], $e->getMessage()));
} catch (\danog\MadelineProto\Exception $e) {
yield from $this->webAPIEcho(\sprintf(Lang::$current_lang['apiError'], $e->getMessage()));
yield $this->webAPIEcho(\sprintf(Lang::$current_lang['apiError'], $e->getMessage()));
}
}
}