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:
parent
01211eae0f
commit
43aa09a88b
18 changed files with 138 additions and 82 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue