Skip to content

Commit

Permalink
feat(Telegram Node): Allow querying chat administrators (#3226)
Browse files Browse the repository at this point in the history
* ✨ Add Get Telegram Chat Administrators

* feat(Microsoft Dynamics CRM Node): Add support for other regions than North America (#3157)

* Typo

* Added all dynamics regions

* Change uri to match credentials region

* ⚡ Small improvement

Co-authored-by: ricardo <ricardoespinoza105@gmail.com>

* ⚡ Return data in correct format

Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com>
Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
  • Loading branch information
4 people committed May 2, 2022
1 parent 4bdd607 commit c02d259
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 22 additions & 4 deletions packages/nodes-base/nodes/Telegram/Telegram.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,20 @@ export class Telegram implements INodeType {
description: 'Get up to date information about a chat.',
},
{
name: 'Leave',
value: 'leave',
description: 'Leave a group, supergroup or channel.',
name: 'Get Administrators',
value: 'administrators',
description: 'Get the Administrators of a chat.',
},
{
name: 'Member',
name: 'Get Member',
value: 'member',
description: 'Get the member of a chat.',
},
{
name: 'Leave',
value: 'leave',
description: 'Leave a group, supergroup or channel.',
},
{
name: 'Set Description',
value: 'setDescription',
Expand Down Expand Up @@ -293,6 +298,7 @@ export class Telegram implements INodeType {
displayOptions: {
show: {
operation: [
'administrators',
'deleteMessage',
'get',
'leave',
Expand Down Expand Up @@ -1909,6 +1915,15 @@ export class Telegram implements INodeType {

body.chat_id = this.getNodeParameter('chatId', i) as string;

} else if (operation === 'administrators') {
// ----------------------------------
// chat:administrators
// ----------------------------------

endpoint = 'getChatAdministrators';

body.chat_id = this.getNodeParameter('chatId', i) as string;

} else if (operation === 'leave') {
// ----------------------------------
// chat:leave
Expand Down Expand Up @@ -2207,6 +2222,9 @@ export class Telegram implements INodeType {
});
continue;
}
} else if (resource === 'chat' && operation === 'administrators') {
returnData.push(...this.helpers.returnJsonArray(responseData.result));
continue;
}

// if (resource === 'bot' && operation === 'info') {
Expand Down

0 comments on commit c02d259

Please sign in to comment.