mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
⚡ Telegram Trigger node function for checking if webhook exists (#915)
* ⚡ Trigger checkExists function * ⚡ Fixed checkExists logic to ensure API registered webhook URL matches local
This commit is contained in:
parent
ebc52acdbc
commit
f291315359
|
@ -112,6 +112,14 @@ export class TelegramTrigger implements INodeType {
|
||||||
webhookMethods = {
|
webhookMethods = {
|
||||||
default: {
|
default: {
|
||||||
async checkExists(this: IHookFunctions): Promise<boolean> {
|
async checkExists(this: IHookFunctions): Promise<boolean> {
|
||||||
|
const endpoint = 'getWebhookInfo';
|
||||||
|
const webhookReturnData = await apiRequest.call(this, 'POST', endpoint, {});
|
||||||
|
const webhookUrl = this.getNodeWebhookUrl('default');
|
||||||
|
|
||||||
|
if (webhookReturnData.result.url === webhookUrl) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
async create(this: IHookFunctions): Promise<boolean> {
|
async create(this: IHookFunctions): Promise<boolean> {
|
||||||
|
|
Loading…
Reference in a new issue