DmitrMakeev commited on
Commit
050d1f6
1 Parent(s): 975e48d

Update up_gr.html

Browse files
Files changed (1) hide show
  1. 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').map(line => line.trim() + '@c.us').filter(line => line);
 
 
 
 
 
 
 
 
 
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