MCPcopy Create free account
hub / github.com/TGX-Android/Publisher / runServer

Function runServer

main.js:162–195  ·  view source on GitHub ↗
(onClose, detached)

Source from the content-addressed store, hash-verified

160 uploaded_version: -1,
161 killServer: false,
162 server: null
163};
164
165function runServer (onClose, detached) {
166 detached = !!detached;
167 const server = spawn('telegram-bot-api',
168 [
169 '--api-id=' + TELEGRAM_APP_ID,
170 '--api-hash=' + TELEGRAM_APP_HASH,
171 '--local',
172 '--dir=' + process.cwd() + '/server',
173 '--log=' + process.cwd() + '/server.log',
174 '--verbosity=' + (settings.server_verbosity || 1)
175 ],
176 {detached}
177 );
178 server.stdout.on('data', (data) => {
179 if (LOCAL) {
180 console.log('Server says:', data);
181 }
182 });
183 server.stderr.on('data', (data) => {
184 if (LOCAL) {
185 console.log('Server cries:', data);
186 }
187 });
188 server.on('close', (code) => {
189 console.log(`Server process exited with code ${code}`);
190 if (onClose) {
191 onClose(server);
192 }
193 });
194 if (detached) {
195 server.unref();
196 }
197 return server;
198}

Callers 1

main.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected