Update up_gr.html
Browse files- up_gr.html +10 -1
up_gr.html
CHANGED
|
@@ -87,7 +87,16 @@
|
|
| 87 |
const reader = new FileReader();
|
| 88 |
reader.onload = async function(event) {
|
| 89 |
const text = event.target.result;
|
| 90 |
-
const chatIds = text.split('\n')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
const payload = {
|
| 92 |
groupName: groupName,
|
| 93 |
chatIds: chatIds
|
|
|
|
| 87 |
const reader = new FileReader();
|
| 88 |
reader.onload = async function(event) {
|
| 89 |
const text = event.target.result;
|
| 90 |
+
const chatIds = text.split('\n')
|
| 91 |
+
.map(line => line.trim())
|
| 92 |
+
.filter(line => line && /^\d+$/.test(line))
|
| 93 |
+
.map(line => line + '@c.us');
|
| 94 |
+
|
| 95 |
+
if (chatIds.length === 0) {
|
| 96 |
+
alert('The file must contain valid phone numbers.');
|
| 97 |
+
return;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
const payload = {
|
| 101 |
groupName: groupName,
|
| 102 |
chatIds: chatIds
|