1
0
Fork 0
mirror of https://github.com/muerwre/vk-tg-bot.git synced 2025-04-25 23:16:41 +07:00

#4 made strict type checking

This commit is contained in:
Fedor Katurov 2021-05-06 15:35:15 +07:00
parent 01211eae0f
commit 43aa09a88b
18 changed files with 138 additions and 82 deletions

View file

@ -40,7 +40,7 @@ export class TelegramService {
if (isWebhookEnabled) {
await this.bot.telegram
.deleteWebhook()
.then(() => this.bot.telegram.setWebhook(this.webhook.url))
.then(() => this.bot.telegram.setWebhook(this.webhook.url!))
.then(async () => {
const info = await this.bot.telegram.getWebhookInfo();
if (!info.url) {
@ -71,7 +71,7 @@ export class TelegramService {
* Checks webhook availability
*/
private getWebhookAvailable = async (): Promise<boolean> => {
const isWebhookEnabled = this.webhook.enabled && this.webhook.url;
const isWebhookEnabled = !!this.webhook.enabled && !!this.webhook.url;
// TODO: test this.webhook.url with axios instead of 'true'
return isWebhookEnabled && true;
};