mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
⚡ Trigger checkExists function
This commit is contained in:
parent
409b9abfbc
commit
3ea9c860aa
|
@ -112,7 +112,16 @@ export class TelegramTrigger implements INodeType {
|
|||
webhookMethods = {
|
||||
default: {
|
||||
async checkExists(this: IHookFunctions): Promise<boolean> {
|
||||
return false;
|
||||
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 true;
|
||||
},
|
||||
async create(this: IHookFunctions): Promise<boolean> {
|
||||
const webhookUrl = this.getNodeWebhookUrl('default');
|
||||
|
|
Loading…
Reference in a new issue