mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
⚡ Fixed checkExists logic to ensure API registered webhook URL matches local
This commit is contained in:
parent
3ea9c860aa
commit
ccc78e08c9
|
@ -114,14 +114,13 @@ export class TelegramTrigger implements INodeType {
|
||||||
async checkExists(this: IHookFunctions): Promise<boolean> {
|
async checkExists(this: IHookFunctions): Promise<boolean> {
|
||||||
const endpoint = 'getWebhookInfo';
|
const endpoint = 'getWebhookInfo';
|
||||||
const webhookReturnData = await apiRequest.call(this, 'POST', endpoint, {});
|
const webhookReturnData = await apiRequest.call(this, 'POST', endpoint, {});
|
||||||
|
const webhookUrl = this.getNodeWebhookUrl('default');
|
||||||
|
|
||||||
//https://core.telegram.org/bots/api#webhookinfo
|
if (webhookReturnData.result.url === webhookUrl) {
|
||||||
// IF Webhook URL is empty if not setup
|
return true;
|
||||||
if (webhookReturnData.result.url === '') {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
},
|
},
|
||||||
async create(this: IHookFunctions): Promise<boolean> {
|
async create(this: IHookFunctions): Promise<boolean> {
|
||||||
const webhookUrl = this.getNodeWebhookUrl('default');
|
const webhookUrl = this.getNodeWebhookUrl('default');
|
||||||
|
|
Loading…
Reference in a new issue