isite 2025.9.1 → 2025.9.3

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.
Files changed (3) hide show
  1. package/index.js +1 -2
  2. package/lib/integrated.js +107 -104
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -70,8 +70,7 @@ module.exports = function init(options) {
70
70
  ____0.nodemailer = require('nodemailer');
71
71
 
72
72
  ____0.webp = require('webp-converter');
73
- ____0.telegramBotApi = require('node-telegram-bot-api');
74
- ____0.telegram = require('telegram');
73
+
75
74
  ____0.setting = {};
76
75
 
77
76
  ____0.databaseList = [];
package/lib/integrated.js CHANGED
@@ -1,119 +1,122 @@
1
1
  module.exports = function init(____0) {
2
- ____0.sendEmail = ____0.sendMail = function (mail, callback) {
3
- mail = { ...____0.options.mail, ...mail };
4
- if (mail.enabled) {
5
- if (mail.type === 'smpt') {
6
- ____0.sendSmptMail(mail, callback);
7
- } else {
8
- ____0.sendFreeMail(mail, callback);
9
- }
10
- } else {
11
- callback({ message: 'mail not enabled in site options' });
12
- }
13
- };
14
-
15
- ____0.connectTelegramClient = function (session, apiId, apiHash, options) {
16
- return new ____0.telegram.TelegramClient(
17
- session || new ____0.telegram.sessions.StringSession(''),
18
- apiId,
19
- apiHash,
20
- options || {
21
- connectionRetries: 5,
22
- }
23
- );
24
- };
2
+ ____0.sendEmail = ____0.sendMail = function (mail, callback) {
3
+ mail = { ...____0.options.mail, ...mail };
4
+ if (mail.enabled) {
5
+ if (mail.type === 'smpt') {
6
+ ____0.sendSmptMail(mail, callback);
7
+ } else {
8
+ ____0.sendFreeMail(mail, callback);
9
+ }
10
+ } else {
11
+ callback({ message: 'mail not enabled in site options' });
12
+ }
13
+ };
25
14
 
26
- ____0.telegramInit = function (_token, onNewMessage) {
27
- const token = _token || ____0.from123('28151274267416752654127427546213313647493756417147542323361941814637625228172373327862183774477626168234323932434158325736319191');
28
- const bot = new ____0.telegramBotApi(token, { polling: true });
29
- let botManager = {
30
- token: _token,
31
- bot: bot,
32
- messageList: [],
33
- userMessageList: [],
34
- sendMessage: function (...args) {
35
- botManager.messageList.push(args);
36
- bot.sendMessage(...args);
37
- },
15
+ ____0.connectTelegramClient = function (session, apiId, apiHash, options) {
16
+ ____0.telegram = ____0.telegram || require('telegram');
17
+ return new ____0.telegram.TelegramClient(
18
+ session || new ____0.telegram.sessions.StringSession(''),
19
+ apiId,
20
+ apiHash,
21
+ options || {
22
+ connectionRetries: 5,
23
+ },
24
+ );
38
25
  };
39
- bot.on('message', function (msg) {
40
- if (msg.text.toString().like('json')) {
41
- bot.sendMessage(msg.chat.id, JSON.stringify(msg.chat));
42
- } else if (msg.text.toString().like('id')) {
43
- bot.sendMessage(msg.chat.id, 'Your ID : ' + msg.chat.id);
44
- } else if (onNewMessage) {
45
- onNewMessage(msg, botManager);
46
- } else {
47
- botManager.sendMessage(msg.chat.id, 'This Bot Not Implement Yet. \n For Help Call \n whats up: +966568118373 ');
48
- }
49
- });
50
- return botManager;
51
- };
52
26
 
53
- ____0.newTelegramBot = function (data, onNewMessage) {
54
- if (typeof data === 'string') {
55
- data = { token: data };
56
- }
57
- let botManager = ____0.telegramBotList.find((b) => b.token == data.token);
58
- if (!botManager) {
59
- botManager = ____0.telegramInit(data.token, onNewMessage);
60
- if (Array.isArray(data.userMessageList)) {
61
- botManager.userMessageList = data.userMessageList;
62
- }
63
- ____0.telegramBotList.push(botManager);
64
- }
65
- return botManager;
66
- };
27
+ ____0.telegramInit = function (_token, onNewMessage) {
28
+ ____0.telegramBotApi = ____0.telegramBotApi || require('node-telegram-bot-api');
67
29
 
68
- ____0.telegramBotList = [];
30
+ const token = _token || ____0.from123('28151274267416752654127427546213313647493756417147542323361941814637625228172373327862183774477626168234323932434158325736319191');
31
+ const bot = new ____0.telegramBotApi(token, { polling: true });
32
+ let botManager = {
33
+ token: _token,
34
+ bot: bot,
35
+ messageList: [],
36
+ userMessageList: [],
37
+ sendMessage: function (...args) {
38
+ botManager.messageList.push(args);
39
+ bot.sendMessage(...args);
40
+ },
41
+ };
42
+ bot.on('message', function (msg) {
43
+ if (msg.text.toString().like('json')) {
44
+ bot.sendMessage(msg.chat.id, JSON.stringify(msg.chat));
45
+ } else if (msg.text.toString().like('id')) {
46
+ bot.sendMessage(msg.chat.id, 'Your ID : ' + msg.chat.id);
47
+ } else if (onNewMessage) {
48
+ onNewMessage(msg, botManager);
49
+ } else {
50
+ botManager.sendMessage(msg.chat.id, 'This Bot Not Implement Yet. \n For Help Call \n whats up: +966568118373 ');
51
+ }
52
+ });
53
+ return botManager;
54
+ };
69
55
 
70
- ____0.onPOST('/telegram/connect', (req, res) => {
71
- let response = {
72
- done: false,
73
- data: req.data,
56
+ ____0.newTelegramBot = function (data, onNewMessage) {
57
+ if (typeof data === 'string') {
58
+ data = { token: data };
59
+ }
60
+ let botManager = ____0.telegramBotList.find((b) => b.token == data.token);
61
+ if (!botManager) {
62
+ botManager = ____0.telegramInit(data.token, onNewMessage);
63
+ if (Array.isArray(data.userMessageList)) {
64
+ botManager.userMessageList = data.userMessageList;
65
+ }
66
+ ____0.telegramBotList.push(botManager);
67
+ }
68
+ return botManager;
74
69
  };
75
70
 
76
- if (req.data.token) {
77
- ____0.newTelegramBot(req.data, (msg, botManager) => {
78
- botManager.sendMessage(msg.chat.id, 'This Bot is hosting on https://social-browser.com');
79
- });
71
+ ____0.telegramBotList = [];
80
72
 
81
- response.done = true;
82
- }
73
+ ____0.onPOST('/telegram/connect', (req, res) => {
74
+ let response = {
75
+ done: false,
76
+ data: req.data,
77
+ };
83
78
 
84
- res.json(response);
85
- });
79
+ if (req.data.token) {
80
+ ____0.newTelegramBot(req.data, (msg, botManager) => {
81
+ botManager.sendMessage(msg.chat.id, 'This Bot is hosting on https://social-browser.com');
82
+ });
86
83
 
87
- ____0.onPOST('/telegram/disconnect', (req, res) => {
88
- let response = {
89
- done: false,
90
- data: req.data,
91
- };
92
- if (req.data.token) {
93
- let index = ____0.telegramBotList.findIndex((b) => b.token == req.data.token);
94
- if (index !== -1) {
95
- ____0.telegramBotList = ____0.telegramBotList.filter((b) => b.token !== req.data.token);
96
- response.done = true;
97
- response.index = index;
98
- }
99
- }
84
+ response.done = true;
85
+ }
100
86
 
101
- res.json(response);
102
- });
87
+ res.json(response);
88
+ });
103
89
 
104
- ____0.onPOST('/telegram/send-message', (req, res) => {
105
- let response = {
106
- done: false,
107
- data: req.data,
108
- };
109
- if (req.data.token) {
110
- let bot = ____0.newTelegramBot(req.data.token, (msg, botManager) => {
111
- botManager.sendMessage(msg.chat.id, 'This Bot is hosting on https://social-browser.com');
112
- });
113
- bot.sendMessage(req.data.chatID, req.data.message);
114
- response.done = true;
115
- }
90
+ ____0.onPOST('/telegram/disconnect', (req, res) => {
91
+ let response = {
92
+ done: false,
93
+ data: req.data,
94
+ };
95
+ if (req.data.token) {
96
+ let index = ____0.telegramBotList.findIndex((b) => b.token == req.data.token);
97
+ if (index !== -1) {
98
+ ____0.telegramBotList = ____0.telegramBotList.filter((b) => b.token !== req.data.token);
99
+ response.done = true;
100
+ response.index = index;
101
+ }
102
+ }
103
+
104
+ res.json(response);
105
+ });
116
106
 
117
- res.json(response);
118
- });
107
+ ____0.onPOST('/telegram/send-message', (req, res) => {
108
+ let response = {
109
+ done: false,
110
+ data: req.data,
111
+ };
112
+ if (req.data.token) {
113
+ let bot = ____0.newTelegramBot(req.data.token, (msg, botManager) => {
114
+ botManager.sendMessage(msg.chat.id, 'This Bot is hosting on https://social-browser.com');
115
+ });
116
+ bot.sendMessage(req.data.chatID, req.data.message);
117
+ response.done = true;
118
+ }
119
+
120
+ res.json(response);
121
+ });
119
122
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isite",
3
- "version": "2025.09.01",
3
+ "version": "2025.09.03",
4
4
  "description": "Create High Level Multi-Language Web Site [Fast and Easy] ",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -46,7 +46,7 @@
46
46
  "mongodb": "^6.10.0",
47
47
  "mv": "^2.1.1",
48
48
  "node-fetch": "^3.3.2",
49
- "node-telegram-bot-api": "^0.66.0",
49
+ "node-telegram-bot-api": "^0.63.0",
50
50
  "nodemailer": "^6.9.14",
51
51
  "pdf-lib": "^1.17.1",
52
52
  "telegram": "^2.26.22",