@patricktobias86/node-red-telegram-account 1.0.9 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.editorconfig ADDED
@@ -0,0 +1,12 @@
1
+ # EditorConfig is awesome: https://EditorConfig.org
2
+
3
+ # top-most EditorConfig file
4
+ root = true
5
+
6
+ [*]
7
+ indent_style = space
8
+ indent_size = 4
9
+ end_of_line = lf
10
+ charset = utf-8
11
+ trim_trailing_whitespace = false
12
+ insert_final_newline = false
@@ -9,7 +9,7 @@
9
9
  config: { type: 'config', required: false },
10
10
  chatId: { value: '' },
11
11
  userId: { value: '' },
12
- rank: { value: 'Admin' },
12
+ rank: { value: 'admin' },
13
13
  changeInfo: { value: true },
14
14
  postMessages: { value: true },
15
15
  editMessages: { value: true },
@@ -44,7 +44,7 @@
44
44
  </div>
45
45
 
46
46
  <div class="form-row">
47
- <label for="node-input-chatId"><i class="fa fa-users"></i> Group Chat ID</label>
47
+ <label for="node-input-chatId"><i class="fa fa-users"></i> Chat ID</label>
48
48
  <input type="text" id="node-input-chatId" placeholder="@groupname or ID">
49
49
  </div>
50
50
 
@@ -55,24 +55,140 @@
55
55
 
56
56
  <div class="form-row">
57
57
  <label for="node-input-rank"><i class="fa fa-star"></i> Admin Rank</label>
58
- <input type="text" id="node-input-rank" placeholder="e.g. Admin, Moderator">
58
+ <input type="text" id="node-input-rank" placeholder="e.g. admin">
59
59
  </div>
60
60
 
61
- <fieldset style="border: 1px solid #ccc; padding: 10px; margin-top: 1rem;">
62
- <legend><i class="fa fa-unlock-alt"></i> Admin Rights</legend>
61
+ <div id="node-input-permissions-container" class="red-ui-treeList" tabindex="0" style="width: 100%; height: 100%;">
62
+ <div class="red-ui-treeList-container">
63
+ <div class="red-ui-editableList" style="inset: 0px; position: absolute;">
64
+ <div class="red-ui-editableList-border red-ui-editableList-container" style="inset: 0px; position: absolute; max-height: none; overflow-y: auto;">
65
+ <ol class="red-ui-treeList-list red-ui-editableList-list" style="position: static; inset: auto; height: auto;">
66
+ <li>
67
+ <div class="red-ui-editableList-item-content">
68
+ <div class="red-ui-treeList-label" style="justify-content: flex-start;">
69
+ <span class="red-ui-treeList-icon" style="width: unset; text-align: left; display: inline-flex;">
70
+ <input class="red-ui-treeList-checkbox" style="margin: 5px 5px 10px 5px;" type="checkbox" id="node-input-changeInfo">
71
+ <label for="node-input-changeInfo">Can change group info</label>
72
+ </span>
73
+ </div>
74
+ </div>
75
+ </li>
76
+
77
+ <li>
78
+ <div class="red-ui-editableList-item-content">
79
+ <div class="red-ui-treeList-label" style="justify-content: flex-start;">
80
+ <span class="red-ui-treeList-icon" style="width: unset; text-align: left; display: inline-flex;">
81
+ <input class="red-ui-treeList-checkbox" style="margin: 5px 5px 10px 5px;" type="checkbox" id="node-input-postMessages">
82
+ <label for="node-input-postMessages">Can post messages</label>
83
+ </span>
84
+ </div>
85
+ </div>
86
+ </li>
87
+ <li>
88
+ <div class="red-ui-editableList-item-content">
89
+ <div class="red-ui-treeList-label" style="justify-content: flex-start;">
90
+ <span class="red-ui-treeList-icon" style="width: unset; text-align: left; display: inline-flex;">
91
+ <input class="red-ui-treeList-checkbox" style="margin: 5px 5px 10px 5px;" type="checkbox" id="node-input-editMessages">
92
+ <label for="node-input-editMessages">Can edit messages</label>
93
+ </span>
94
+ </div>
95
+ </div>
96
+ </li>
97
+
98
+ <li>
99
+ <div class="red-ui-editableList-item-content">
100
+ <div class="red-ui-treeList-label" style="justify-content: flex-start;">
101
+ <span class="red-ui-treeList-icon" style="width: unset; text-align: left; display: inline-flex;">
102
+ <input class="red-ui-treeList-checkbox" style="margin: 5px 5px 10px 5px;" type="checkbox" id="node-input-deleteMessages">
103
+ <label for="node-input-deleteMessages">Can delete messages</label>
104
+ </span>
105
+ </div>
106
+ </div>
107
+ </li>
108
+
109
+ <li>
110
+ <div class="red-ui-editableList-item-content">
111
+ <div class="red-ui-treeList-label" style="justify-content: flex-start;">
112
+ <span class="red-ui-treeList-icon" style="width: unset; text-align: left; display: inline-flex;">
113
+ <input class="red-ui-treeList-checkbox" style="margin: 5px 5px 10px 5px;" type="checkbox" id="node-input-banUsers">
114
+ <label for="node-input-banUsers">Can ban users</label>
115
+ </span>
116
+ </div>
117
+ </div>
118
+ </li>
119
+
120
+ <li>
121
+ <div class="red-ui-editableList-item-content">
122
+ <div class="red-ui-treeList-label" style="justify-content: flex-start;">
123
+ <span class="red-ui-treeList-icon" style="width: unset; text-align: left; display: inline-flex;">
124
+ <input class="red-ui-treeList-checkbox" style="margin: 5px 5px 10px 5px;" type="checkbox" id="node-input-inviteUsers">
125
+ <label for="node-input-inviteUsers">Can invite users</label>
126
+ </span>
127
+ </div>
128
+ </div>
129
+ </li>
130
+
131
+ <li>
132
+ <div class="red-ui-editableList-item-content">
133
+ <div class="red-ui-treeList-label" style="justify-content: flex-start;">
134
+ <span class="red-ui-treeList-icon" style="width: unset; text-align: left; display: inline-flex;">
135
+ <input class="red-ui-treeList-checkbox" style="margin: 5px 5px 10px 5px;" type="checkbox" id="node-input-pinMessages">
136
+ <label for="node-input-pinMessages">Can pin messages</label>
137
+ </span>
138
+ </div>
139
+ </div>
140
+ </li>
141
+
142
+ <li>
143
+ <div class="red-ui-editableList-item-content">
144
+ <div class="red-ui-treeList-label" style="justify-content: flex-start;">
145
+ <span class="red-ui-treeList-icon" style="width: unset; text-align: left; display: inline-flex;">
146
+ <input class="red-ui-treeList-checkbox" style="margin: 5px 5px 10px 5px;" type="checkbox" id="node-input-addAdmins">
147
+ <label for="node-input-addAdmins">Can add new admins</label>
148
+ </span>
149
+ </div>
150
+ </div>
151
+ </li>
152
+
153
+ <li>
154
+ <div class="red-ui-editableList-item-content">
155
+ <div class="red-ui-treeList-label" style="justify-content: flex-start;">
156
+ <span class="red-ui-treeList-icon" style="width: unset; text-align: left; display: inline-flex;">
157
+ <input class="red-ui-treeList-checkbox" style="margin: 5px 5px 10px 5px;" type="checkbox" id="node-input-manageCall">
158
+ <label for="node-input-manageCall">Can manage voice/video chats</label>
159
+ </span>
160
+ </div>
161
+ </div>
162
+ </li>
163
+
164
+ <li>
165
+ <div class="red-ui-editableList-item-content">
166
+ <div class="red-ui-treeList-label" style="justify-content: flex-start;">
167
+ <span class="red-ui-treeList-icon" style="width: unset; text-align: left; display: inline-flex;">
168
+ <input class="red-ui-treeList-checkbox" style="margin: 5px 5px 10px 5px;" type="checkbox" id="node-input-anonymous">
169
+ <label for="node-input-anonymous">Is anonymous (hidden from group)</label>
170
+ </span>
171
+ </div>
172
+ </div>
173
+ </li>
174
+
175
+ <li>
176
+ <div class="red-ui-editableList-item-content">
177
+ <div class="red-ui-treeList-label" style="justify-content: flex-start;">
178
+ <span class="red-ui-treeList-icon" style="width: unset; text-align: left; display: inline-flex;">
179
+ <input class="red-ui-treeList-checkbox" style="margin: 5px 5px 10px 5px;" type="checkbox" id="node-input-manageTopics">
180
+ <label for="node-input-manageTopics">Can manage topics</label>
181
+ </span>
182
+ </div>
183
+ </div>
184
+ </li>
185
+
186
+ </ol>
187
+ </div>
188
+ </div>
189
+ </div>
190
+ </div>
63
191
 
64
- <div><input type="checkbox" id="node-input-changeInfo"> <label for="node-input-changeInfo">Can change group info</label></div>
65
- <div><input type="checkbox" id="node-input-postMessages"> <label for="node-input-postMessages">Can post messages</label></div>
66
- <div><input type="checkbox" id="node-input-editMessages"> <label for="node-input-editMessages">Can edit messages</label></div>
67
- <div><input type="checkbox" id="node-input-deleteMessages"> <label for="node-input-deleteMessages">Can delete messages</label></div>
68
- <div><input type="checkbox" id="node-input-banUsers"> <label for="node-input-banUsers">Can ban users</label></div>
69
- <div><input type="checkbox" id="node-input-inviteUsers"> <label for="node-input-inviteUsers">Can invite users</label></div>
70
- <div><input type="checkbox" id="node-input-pinMessages"> <label for="node-input-pinMessages">Can pin messages</label></div>
71
- <div><input type="checkbox" id="node-input-addAdmins"> <label for="node-input-addAdmins">Can add new admins</label></div>
72
- <div><input type="checkbox" id="node-input-manageCall"> <label for="node-input-manageCall">Can manage voice/video chats</label></div>
73
- <div><input type="checkbox" id="node-input-anonymous"> <label for="node-input-anonymous">Is anonymous (hidden from group)</label></div>
74
- <div><input type="checkbox" id="node-input-manageTopics"> <label for="node-input-manageTopics">Can manage topics</label></div>
75
- </fieldset>
76
192
  </script>
77
193
  <script type="text/html" data-help-name="promote-admin">
78
194
  <p><b>Promote Admin</b> lets you promote a user to admin in a Telegram group or channel using the Telegram MTProto API (via GramJS).</p>
@@ -120,7 +236,7 @@
120
236
  "payload": {
121
237
  "chatId": "@mygroup",
122
238
  "userId": "@targetuser",
123
- "rank": "Moderator",
239
+ "rank": "admin",
124
240
  "banUsers": true,
125
241
  "pinMessages": true
126
242
  }
@@ -10,10 +10,9 @@ module.exports = function (RED) {
10
10
 
11
11
  this.on('input', async function (msg) {
12
12
  const client = msg.payload?.client || this.config.client;
13
-
14
13
  const chatId = msg.payload.chatId || config.chatId;
15
14
  const userId = msg.payload.userId || config.userId;
16
- const rank = msg.payload.rank || config.rank || "Admin";
15
+ const rank = msg.payload.rank || config.rank || "admin";
17
16
 
18
17
  try {
19
18
  const group = chatId[0] === "@" ? await client.getEntity(chatId) : parseID(chatId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patricktobias86/node-red-telegram-account",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "description": "Node-RED nodes to communicate with GramJS.",
5
5
  "main": "nodes/config.js",
6
6
  "keywords": [
@@ -1,4 +0,0 @@
1
- {
2
- "simple.readme.settings.github": "patricktobias86",
3
- "simple.readme.settings.name": "Patrick Tobias"
4
- }