⚡ 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:
@@ -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> {
|
||||||
|
|||||||
Reference in New Issue
Block a user