mirror of
https://github.com/muerwre/vk-tg-bot.git
synced 2025-04-24 22:46:41 +07:00
#5 fixed logs
This commit is contained in:
parent
2bcf8ff772
commit
46d24cd9dd
1 changed files with 5 additions and 4 deletions
|
@ -23,18 +23,19 @@ export class TelegramApi {
|
||||||
* Probes webhook url and falls back to polling mode on error
|
* Probes webhook url and falls back to polling mode on error
|
||||||
*/
|
*/
|
||||||
public probe = async () => {
|
public probe = async () => {
|
||||||
if (!this.telegram.webhook.enabled || !this.telegram.webhook.url) {
|
if (!this.telegram.isWebhookEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await axios.get(this.telegram.webhook.url);
|
await axios.get(this.telegram.webhook.url!);
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
`probing telegram webhook at ${this.telegram.webhook.url} succeeded`
|
`probing telegram webhook at ${this.telegram.webhook.url}: ok`
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.warn(
|
logger.warn(
|
||||||
`probing telegram webhook at ${this.telegram.webhook.url} failed, falling back to polling mode`
|
`probing telegram webhook at ${this.telegram.webhook.url}: FAILED, falling back to polling mode`
|
||||||
);
|
);
|
||||||
await this.telegram.bot.launch();
|
await this.telegram.bot.launch();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue