mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
⚡ Trigger checkExists function
This commit is contained in:
@@ -112,7 +112,16 @@ 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, {});
|
||||||
|
|
||||||
|
//https://core.telegram.org/bots/api#webhookinfo
|
||||||
|
// IF Webhook URL is empty if not setup
|
||||||
|
if (webhookReturnData.result.url === '') {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
async create(this: IHookFunctions): Promise<boolean> {
|
async create(this: IHookFunctions): Promise<boolean> {
|
||||||
const webhookUrl = this.getNodeWebhookUrl('default');
|
const webhookUrl = this.getNodeWebhookUrl('default');
|
||||||
|
|||||||
Reference in New Issue
Block a user