Giter Site home page Giter Site logo

shell-bot's Introduction

shell-bot

This is a fully functional shellrunner Telegram bot. You tell it a command, it executes it and posts the live output. You can send input to the command by replying to the output messages.

It's a fairly complex example, because it actually appears to the command as a terminal, interprets escape sequences and it will update messages if their lines get touched. This means interactive programs such as wget should work naturally, you should see the status bar update.

The bot also allows files to be uploaded or downloaded, and also has a simple text editor available for convenience.

Here's an example of the bot running git to clone a repository:

Basic tasks

Here's an example of the bot running alsamixer:

Alsamixer with keypad

This bot demonstrates a great part of Botgram's API.

Note: Due to the tight integration, running this bot on Windows is currently not supported.

Install

First install node-pty dependencies. For example, if you're in Ubuntu/Debian:

sudo apt install -y make python build-essential

If you're using fedora instead:

sudo dnf install -y python
sudo dnf group install -y "C Development Tools and Libraries" 

Before using this, you should have obtained an auth token for your bot, and know your personal user's numeric ID. If you don't know what this means, check out the blog post for a full step-by-step guide.

git clone https://github.com/botgram/shell-bot.git && cd shell-bot
npm install

To start the bot:

node server

The first time you run it, it will ask you some questions and create the configuration file automatically: config.json. You can also write it manually, see config.example.json.

When started it will print a Bot ready. message when it's up and running. For convenience, you might want to talk to the BotFather and set the command list to the contents of commands.txt.

Authorization

When first started, the bot will just accept messages coming from your user. This is for security reasons: you don't want arbitrary people to issue commands to your computer!

If you want to allow another user to use the bot, use /token and give that user the resulting link. If you want to use this bot on a group, /token will give you a message to forward into the group.

Proxy server

shell-bot obeys the https_proxy or all_proxy environment variable to use a proxy, and supports HTTP/HTTPS/SOCKS4/SOCKS4A/SOCKS5 proxies. Examples:

export https_proxy="http://168.63.76.32:3128"
node server

export https_proxy="socks://127.0.0.1:9050"
node server

Warning: For SOCKS proxies, you need to use an IP address (not a DNS hostname).

shell-bot's People

Contributors

mildsunrise avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shell-bot's Issues

Hello botgram support

Hi

I have one question is /token or /grant command save credentials as text file for remebering the user ?
If not then is their any way to give user access through the config.json file same method for the /resize command
I'm asking this because my machine reboots every 24h

Thankyou

How to custom output of command /run to style code?

I have issue when running /run command, for example :

I have a file test.txt with contain like below :
Hello World!

I want when do /run cat test.txt the output should be :

Hello World!

Look like using parameter <code>Hello World!</code>. Any ideas?

Build error

Hi, is this project still supported?

I have NPM 6.5.0 and build-essentials installed on Debian. When I try to install the bot I got the following error:

pty.target.mk:99: recipe for target 'Release/obj.target/pty/src/unix/pty.o' failed
make: *** [Release/obj.target/pty/src/unix/pty.o] Error 1
make: Leaving directory '/home/dietpi/shell-bot/node_modules/pty.js/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Linux 4.14.79-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/dietpi/shell-bot/node_modules/pty.js
gyp ERR! node -v v11.9.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/dietpi/.npm/_logs/2019-02-04T17_19_03_693Z-debug.log

Thanks for the help and awesome project!

Edit:

Here is the full log of the install:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'install' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 56f59fecf5148bf8
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall [email protected]
7 info lifecycle [email protected]~preinstall: [email protected]
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing stage:loadCurrentTree Completed in 554ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 6ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 67ms
16 silly install loadAllDepsIntoIdealTree
17 http fetch GET 304 https://registry.npmjs.org/pty.js 790ms (from cache)
18 silly pacote range manifest for [email protected] fetched in 890ms
19 http fetch GET 304 https://registry.npmjs.org/extend 180ms (from cache)
20 silly pacote range manifest for extend@~1.2.1 fetched in 195ms
21 http fetch GET 304 https://registry.npmjs.org/nan 272ms (from cache)
22 silly pacote version manifest for [email protected] fetched in 292ms
23 silly pacote range manifest for [email protected] fetched in 21ms
24 silly resolveWithNewModule [email protected] checking installable status
25 silly pacote range manifest for extend@~1.2.1 fetched in 15ms
26 silly resolveWithNewModule [email protected] checking installable status
27 silly pacote version manifest for [email protected] fetched in 21ms
28 silly resolveWithNewModule [email protected] checking installable status
29 timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 2585ms
30 timing stage:loadIdealTree Completed in 2747ms
31 silly currentTree [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree ├── [email protected]
31 silly currentTree └── [email protected]
32 silly idealTree [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree ├── [email protected]
32 silly idealTree └── [email protected]
33 silly install generateActionsToTake
34 timing stage:generateActionsToTake Completed in 61ms
35 silly diffTrees action count 3
36 silly diffTrees add [email protected]
37 silly diffTrees add [email protected]
38 silly diffTrees add [email protected]
39 silly decomposeActions action count 24
40 silly decomposeActions fetch [email protected]
41 silly decomposeActions extract [email protected]
42 silly decomposeActions preinstall [email protected]
43 silly decomposeActions build [email protected]
44 silly decomposeActions install [email protected]
45 silly decomposeActions postinstall [email protected]
46 silly decomposeActions finalize [email protected]
47 silly decomposeActions refresh-package-json [email protected]
48 silly decomposeActions fetch [email protected]
49 silly decomposeActions extract [email protected]
50 silly decomposeActions preinstall [email protected]
51 silly decomposeActions build [email protected]
52 silly decomposeActions install [email protected]
53 silly decomposeActions postinstall [email protected]
54 silly decomposeActions finalize [email protected]
55 silly decomposeActions refresh-package-json [email protected]
56 silly decomposeActions fetch [email protected]
57 silly decomposeActions extract [email protected]
58 silly decomposeActions preinstall [email protected]
59 silly decomposeActions build [email protected]
60 silly decomposeActions install [email protected]
61 silly decomposeActions postinstall [email protected]
62 silly decomposeActions finalize [email protected]
63 silly decomposeActions refresh-package-json [email protected]
64 silly install executeActions
65 silly doSerial global-install 24
66 verbose correctMkdir /home/dietpi/.npm/_locks correctMkdir not in flight; initializing
67 timing audit compress Completed in 27ms
68 info audit Submitting payload of 1347bytes
69 verbose lock using /home/dietpi/.npm/_locks/staging-6c46c94766d3a652.lock for /home/dietpi/shell-bot/node_modules/.staging
70 silly doParallel extract 3
71 silly extract [email protected]
72 silly extract [email protected]
73 silly extract [email protected]
74 silly tarball trying extend@~1.2.1 by hash: sha1-oPX9bPyDpf5J72mNYOyKYk3UV2w=
75 silly tarball trying [email protected] by hash: sha1-gioNwmYpDOTNOhIoLKPn42Rmigg=
76 silly tarball trying [email protected] by hash: sha1-gfW+0zLW5eeraFaI0boDc0ENUbU=
77 silly extract extend@~1.2.1 extracted to /home/dietpi/shell-bot/node_modules/.staging/extend-b56b0ba3 (397ms)
78 silly extract [email protected] extracted to /home/dietpi/shell-bot/node_modules/.staging/pty.js-3c4b29e4 (430ms)
79 silly extract [email protected] extracted to /home/dietpi/shell-bot/node_modules/.staging/nan-31150168 (489ms)
80 timing action:extract Completed in 514ms
81 silly doReverseSerial unbuild 24
82 silly doSerial remove 24
83 silly doSerial move 24
84 silly doSerial finalize 24
85 silly finalize /home/dietpi/shell-bot/node_modules/extend
86 silly finalize /home/dietpi/shell-bot/node_modules/nan
87 silly finalize /home/dietpi/shell-bot/node_modules/pty.js
88 timing action:finalize Completed in 46ms
89 silly doParallel refresh-package-json 3
90 silly refresh-package-json /home/dietpi/shell-bot/node_modules/extend
91 silly refresh-package-json /home/dietpi/shell-bot/node_modules/nan
92 silly refresh-package-json /home/dietpi/shell-bot/node_modules/pty.js
93 timing action:refresh-package-json Completed in 143ms
94 silly doParallel preinstall 3
95 silly preinstall [email protected]
96 info lifecycle [email protected]~preinstall: [email protected]
97 silly preinstall [email protected]
98 info lifecycle [email protected]~preinstall: [email protected]
99 silly preinstall [email protected]
100 info lifecycle [email protected]~preinstall: [email protected]
101 timing audit submit Completed in 958ms
102 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 952ms
103 timing audit body Completed in 4ms
104 timing action:preinstall Completed in 18ms
105 silly doSerial build 24
106 silly build [email protected]
107 info linkStuff [email protected]
108 silly linkStuff [email protected] has /home/dietpi/shell-bot/node_modules as its parent node_modules
109 silly build [email protected]
110 info linkStuff [email protected]
111 silly linkStuff [email protected] has /home/dietpi/shell-bot/node_modules as its parent node_modules
112 silly build [email protected]
113 info linkStuff [email protected]
114 silly linkStuff [email protected] has /home/dietpi/shell-bot/node_modules as its parent node_modules
115 timing action:build Completed in 14ms
116 silly doSerial global-link 24
117 silly doParallel update-linked 0
118 silly doSerial install 24
119 silly install [email protected]
120 info lifecycle [email protected]~install: [email protected]
121 silly install [email protected]
122 info lifecycle [email protected]~install: [email protected]
123 silly install [email protected]
124 info lifecycle [email protected]~install: [email protected]
125 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle true
126 verbose lifecycle [email protected]~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/dietpi/shell-bot/node_modules/pty.js/node_modules/.bin:/home/dietpi/shell-bot/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
127 verbose lifecycle [email protected]~install: CWD: /home/dietpi/shell-bot/node_modules/pty.js
128 silly lifecycle [email protected]~install: Args: [ '-c', 'node-gyp rebuild' ]
129 silly lifecycle [email protected]~install: Returned: code: 1  signal: null
130 info lifecycle [email protected]~install: Failed to exec install script
131 timing action:install Completed in 10489ms
132 verbose unlock done using /home/dietpi/.npm/_locks/staging-6c46c94766d3a652.lock for /home/dietpi/shell-bot/node_modules/.staging
133 timing stage:rollbackFailedOptional Completed in 155ms
134 timing stage:runTopLevelLifecycles Completed in 15438ms
135 silly saveTree [email protected]
135 silly saveTree ├─┬ [email protected]
135 silly saveTree │ ├── [email protected]
135 silly saveTree │ ├─┬ [email protected]
135 silly saveTree │ │ ├── [email protected]
135 silly saveTree │ │ ├─┬ [email protected]
135 silly saveTree │ │ │ └── [email protected]
135 silly saveTree │ │ └─┬ [email protected]
135 silly saveTree │ │   └── [email protected]
135 silly saveTree │ └─┬ [email protected]
135 silly saveTree │   └─┬ [email protected]
135 silly saveTree │     ├── [email protected]
135 silly saveTree │     └── [email protected]
135 silly saveTree ├── [email protected]
135 silly saveTree ├── [email protected]
135 silly saveTree ├── [email protected]
135 silly saveTree ├─┬ [email protected]
135 silly saveTree │ ├── [email protected]
135 silly saveTree │ └── [email protected]
135 silly saveTree └── [email protected]
136 verbose stack Error: [email protected] install: `node-gyp rebuild`
136 verbose stack Exit status 1
136 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
136 verbose stack     at EventEmitter.emit (events.js:197:13)
136 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
136 verbose stack     at ChildProcess.emit (events.js:197:13)
136 verbose stack     at maybeClose (internal/child_process.js:978:16)
136 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
137 verbose pkgid [email protected]
138 verbose cwd /home/dietpi/shell-bot
139 verbose Linux 4.14.79-v7+
140 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
141 verbose node v11.9.0
142 verbose npm  v6.5.0
143 error code ELIFECYCLE
144 error errno 1
145 error [email protected] install: `node-gyp rebuild`
145 error Exit status 1
146 error Failed at the [email protected] install script.
146 error This is probably not a problem with npm. There is likely additional logging output above.
147 verbose exit [ 1, true ]

limit commands

is there any possibility to limit commands that bot can run?

thanks in advance

/upload failed

Cool project!
I try to upload a file but encounter an error.
/upload abc.txt

then got error messsage:

Couldn't send file: sendDocument failed: Request Entity Too Large

abc.txt size is ~90MB

Thank you

crashing

events.js:160
throw er; // Unhandled 'error' event
^
NetworkError: Error: connect ETIMEDOUT 149.154.167.197:443
at NetworkError.Error (native)
at new NetworkError (/root/shell-bot/node_modules/botgram/lib/bot.js:21:20)
at ClientRequest.handleResponse (/root/shell-bot/node_modules/botgram/lib/bot.js:129:24)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.socketErrorListener (_http_client.js:310:9)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at emitErrorNT (net.js:1277:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

No documentation on text editor

The text editor has no documentation and it'd be really nice if it had at least a bit, it's a bit of a pain to always do everything via uploading files

This account is currently not available.

I run this with nginx user access

sudo -u nginx /bin/node /var/www/shell-bot/server.js

the log of any command shows nothing error,

Chat «Jade Vane»: running command «df -h»

but i just get this error message in telegram
image
Some potentially useful information:

  • node: v10.20.1
  • npm: 6.14.4

BTW, I dono if this information would be helpful:

$ npm install
audited 29 packages in 1.186s
found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

$ npm audit fix
up to date in 0.242s
fixed 0 of 0 vulnerabilities in 19 scanned packages

Help? how to run? not work !

innerError { Error: Cannot find module '../build/Debug/pty.node'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/root/shell-bot/node_modules/node-pty/lib/unixTerminal.js:30:15)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3) code: 'MODULE_NOT_FOUND' }
/root/shell-bot/node_modules/node-pty/lib/unixTerminal.js:35
throw outerError;
^

Error: Cannot find module '../build/Release/pty.node'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/root/shell-bot/node_modules/node-pty/lib/unixTerminal.js:26:11)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)

error with npm install

Debian buster, 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux

root@i5 /h/floppik# node -v
v13.0.1
root@i5 /h/floppik# npm -v
6.12.0
root@i5 /h/floppik# git clone https://github.com/botgram/shell-bot.git
Клонирование в «shell-bot»…
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 268 (delta 0), reused 1 (delta 0), pack-reused 264
Получение объектов: 100% (268/268), 75.84 KiB | 606.00 KiB/s, готово.
Определение изменений: 100% (168/168), готово.
root@i5 /h/floppik# cd /home/floppik/shell-bot/
root@i5 /h/f/shell-bot# npm install

> [email protected] install /home/floppik/shell-bot/node_modules/node-pty
> node scripts/install.js

gyp WARN EACCES current user ("floppik") does not have permission to access the dev dir "/root/.cache/node-gyp/13.0.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/floppik/shell-bot/node_modules/node-pty/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/floppik/shell-bot/node_modules/node-pty/.node-gyp'
gyp ERR! System Linux 4.19.0-6-amd64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/floppik/shell-bot/node_modules/node-pty
gyp ERR! node -v v13.0.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-11-05T16_23_13_818Z-debug.log
root@i5 /h/f/shell-bot#

Also try nodejs 12, 11, 10, but no luck.

npm install fail on Ubuntu 18.04

~/shell-bot# npm install

> [email protected] install /root/shell-bot/node_modules/node-pty
> node scripts/install.js

make: Entering directory '/root/shell-bot/node_modules/node-pty/build'
  CXX(target) Release/obj.target/pty/src/unix/pty.o
virtual memory exhausted: Cannot allocate memory
pty.target.mk:95: recipe for target 'Release/obj.target/pty/src/unix/pty.o' failed
make: *** [Release/obj.target/pty/src/unix/pty.o] Error 1
make: Leaving directory '/root/shell-bot/node_modules/node-pty/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.15.0-52-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /root/shell-bot/node_modules/node-pty
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! Linux 4.15.0-52-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node scripts/install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-pty package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-pty
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-pty
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/shell-bot/npm-debug.log

Not work on fish

Running node server just hangs on fish. With bash works fine.

Multiple Processes

483 root       20   0  948M 73388 28276 S  0.0  0.0  0:00.00 node ./server.js
484 root       20   0  948M 73388 28276 S  0.0  0.0  0:01.97 node ./server.js                                                      
485 root       20   0  948M 73388 28276 S  0.0  0.0  0:02.17 node ./server.js                                                      
486 root       20   0  948M 73388 28276 S  0.0  0.0  0:02.20 node ./server.js                                                      
487 root       20   0  948M 73388 28276 S  0.0  0.0  0:01.96 node ./server.js                                                      
488 root       20   0  948M 73388 28276 S  0.0  0.0  0:00.00 node ./server.js                                                      
489 root       20   0  948M 73388 28276 S  0.0  0.0  0:02.88 node ./server.js                                                      
490 root       20   0  948M 73388 28276 S  0.0  0.0  0:02.96 node ./server.js                                                      
491 root       20   0  948M 73388 28276 S  0.0  0.0  0:02.86 node ./server.js                                                      
492 root       20   0  948M 73388 28276 S  0.0  0.0  0:02.89 node ./server.js                                                     
5063 root       20   0  948M 73388 28276 S  0.0  0.0  0:00.00 node ./server.js

Y does it starts with multiple processes

node-pty issue ig

Exit code: 1
Command: node scripts/install.js
Arguments: 
Directory: /home/Tgsb_Njs/node_modules/node-pty
Output:
events.js:174
      throw er; // Unhandled 'error' event
      ^
Error: spawn node-gyp ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
    at onErrorNT (internal/child_process.js:415:16)
    [... lines matching original stack trace ...]
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)```

Sudo error

I installed the bot on my Raspberry Pi and it works great. But I have problems with some commands, like pip and apt.
Here's what I get:
IMG_20200123_230754
Yeah, and server running from sudo, i don't know where is problem

How can I fix this?

Cannot find module 'botgram'

Hello,

I've got an issue while trying to run node server, any idea how to fix it?

module.js:549
throw err;
^

Error: Cannot find module 'botgram'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/mnt/d/chatbox/shell-bot/server.js:9:15)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)

Cannot use Conda Env

I have tried just about everything to get a shell to stay open and to be able to activate a conda env. Do you have any suggestions?

failed trying to trying to build on Ubuntu 16.04 with node v4.2.6 and npm v3.5.2

Hi I am trying to build on Ubuntu 16.04 with node v4.2.6 and npm v3.5.2
I installed v10.15.3 and npm 6.4.1 and got the same issue.

48 apt install -y make python build-essential
49 npm -v
50 sudo apt-get install nodejs
51 sudo apt-get install nodejs-legacy
52 sudo apt-get install npm
53 git clone https://github.com/botgram/shell-bot.git && cd shell-bot
54 npm install

And I get the following error:


loadDep:socks-proxy-agent ▄ ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine [email protected]: wanted: {"node":">= 6"} (current: {"node":"                                                    loadDep:socks-proxy-agent ▀ ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine [email protected]: wanted: {"node":">= 4.5.0"} (current: {"nod                                                    loadDep:socks → 200       ▄ ╢██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine [email protected]: wanted: {"node":">= 6.0.0","npm":">= 3.0.0"} (current:                                                     
> [email protected] install /root/shell-bot/node_modules/node-pty
> node scripts/install.js

module.js:328
    throw err;
    ^

Error: Cannot find module '/root/shell-bot/node_modules/node-pty/scripts/install                                                    .js'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3
[email protected] /root/shell-bot
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     ├── [email protected]
│     └── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ └─┬ [email protected]
│   └── [email protected]
├── [email protected]
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   ├── [email protected]
│   └── [email protected]
└── [email protected]

npm ERR! Linux 4.4.0-143-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node scripts/install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-pty package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-pty
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-pty
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/shell-bot/npm-debug.log

root@Ubuntu16:~/shell-bot#

With node 10 I get the following error log...

cat /root/.npm/_logs/2019-03-26T10_31_40_349Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 608aa7399c9933f1
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall [email protected]
7 info lifecycle [email protected]~preinstall: [email protected]
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing stage:loadCurrentTree Completed in 90ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 45ms
16 silly install loadAllDepsIntoIdealTree
17 timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 32ms
18 timing stage:loadIdealTree Completed in 94ms
19 silly currentTree [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree ├── [email protected]
19 silly currentTree └── [email protected]
20 silly idealTree [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree ├── [email protected]
20 silly idealTree └── [email protected]
21 silly install generateActionsToTake
22 timing stage:generateActionsToTake Completed in 10ms
23 silly diffTrees action count 3
24 silly diffTrees update [email protected]
25 silly diffTrees add [email protected]
26 silly diffTrees update [email protected]
27 silly decomposeActions action count 28
28 silly decomposeActions unbuild [email protected]
29 silly decomposeActions remove [email protected]
30 silly decomposeActions fetch [email protected]
31 silly decomposeActions extract [email protected]
32 silly decomposeActions preinstall [email protected]
33 silly decomposeActions build [email protected]
34 silly decomposeActions install [email protected]
35 silly decomposeActions postinstall [email protected]
36 silly decomposeActions finalize [email protected]
37 silly decomposeActions refresh-package-json [email protected]
38 silly decomposeActions fetch [email protected]
39 silly decomposeActions extract [email protected]
40 silly decomposeActions preinstall [email protected]
41 silly decomposeActions build [email protected]
42 silly decomposeActions install [email protected]
43 silly decomposeActions postinstall [email protected]
44 silly decomposeActions finalize [email protected]
45 silly decomposeActions refresh-package-json [email protected]
46 silly decomposeActions unbuild [email protected]
47 silly decomposeActions remove [email protected]
48 silly decomposeActions fetch [email protected]
49 silly decomposeActions extract [email protected]
50 silly decomposeActions preinstall [email protected]
51 silly decomposeActions build [email protected]
52 silly decomposeActions install [email protected]
53 silly decomposeActions postinstall [email protected]
54 silly decomposeActions finalize [email protected]
55 silly decomposeActions refresh-package-json [email protected]
56 silly install executeActions
57 silly doSerial global-install 28
58 verbose correctMkdir /root/.npm/_locks correctMkdir not in flight; initializing
59 timing audit compress Completed in 5ms
60 info audit Submitting payload of 1520bytes
61 verbose lock using /root/.npm/_locks/staging-08b964d67b451cf4.lock for /root/shell-bot/node_modules/.staging
62 silly doParallel extract 3
63 silly extract [email protected]
64 silly extract [email protected]
65 silly extract [email protected]
66 silly tarball trying [email protected] by hash: sha512-+2r83WaRT3PXYoO/1z+RDEBE7Z2f9YcdQnJ0K/ncXXbV5gJ6wYfNAebYFYiiUjM6E4JyXnPY8cimwyvFYHVUUA==
67 silly tarball trying [email protected] by hash: sha512-j+/g0Q5dR+vkELclpJpz32HcS3O/3EdPSGPvDXJZVJQLCvgG0toEbfmymxAEyQyZEpaoKHAcoL+PvKM+4N9nlw==
68 silly tarball trying [email protected] by hash: sha512-Kezx6/VBguXOsEe5oU3lXYyKMi4+gva72TwJ7pQY5JfqUx2nMk7NXA6z/mpNqIlfQjWYVfeuNvQjexiTaTn6Nw==
69 silly tarball no local data for [email protected]. Extracting by manifest.
70 silly tarball no local data for [email protected]. Extracting by manifest.
71 silly tarball no local data for [email protected]. Extracting by manifest.
72 http fetch GET 200 https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz 220ms
73 http fetch GET 200 https://registry.npmjs.org/socks/-/socks-2.2.3.tgz 230ms
74 silly extract [email protected] extracted to /root/shell-bot/node_modules/.staging/socks-proxy-agent-042b4020 (246ms)
75 silly extract [email protected] extracted to /root/shell-bot/node_modules/.staging/socks-8e40702b (297ms)
76 http fetch GET 200 https://registry.npmjs.org/node-pty/-/node-pty-0.8.1.tgz 367ms
77 silly extract [email protected] extracted to /root/shell-bot/node_modules/.staging/node-pty-15f1b2ec (393ms)
78 timing action:extract Completed in 398ms
79 silly doReverseSerial unbuild 28
80 silly unbuild [email protected]
81 info lifecycle [email protected]~preuninstall: [email protected]
82 info lifecycle [email protected]~uninstall: [email protected]
83 verbose unbuild rmStuff [email protected] from /root/shell-bot/node_modules
84 info lifecycle [email protected]~postuninstall: [email protected]
85 silly unbuild [email protected]
86 info lifecycle [email protected]~preuninstall: [email protected]
87 info lifecycle [email protected]~uninstall: [email protected]
88 verbose unbuild rmStuff [email protected] from /root/shell-bot/node_modules
89 info lifecycle [email protected]~postuninstall: [email protected]
90 timing action:unbuild Completed in 3ms
91 silly doSerial remove 28
92 silly remove /root/shell-bot/node_modules/socks
93 silly remove /root/shell-bot/node_modules/socks-proxy-agent
94 timing action:remove Completed in 23ms
95 silly doSerial move 28
96 silly doSerial finalize 28
97 silly finalize /root/shell-bot/node_modules/socks
98 silly finalize /root/shell-bot/node_modules/node-pty
99 silly finalize /root/shell-bot/node_modules/socks-proxy-agent
100 timing action:finalize Completed in 5ms
101 silly doParallel refresh-package-json 3
102 silly refresh-package-json /root/shell-bot/node_modules/socks
103 silly refresh-package-json /root/shell-bot/node_modules/node-pty
104 silly refresh-package-json /root/shell-bot/node_modules/socks-proxy-agent
105 timing action:refresh-package-json Completed in 13ms
106 silly doParallel preinstall 3
107 silly preinstall [email protected]
108 info lifecycle [email protected]~preinstall: [email protected]
109 silly preinstall [email protected]
110 info lifecycle [email protected]~preinstall: [email protected]
111 silly preinstall [email protected]
112 info lifecycle [email protected]~preinstall: [email protected]
113 timing action:preinstall Completed in 1ms
114 silly doSerial build 28
115 silly build [email protected]
116 info linkStuff [email protected]
117 silly linkStuff [email protected] has /root/shell-bot/node_modules as its parent node_modules
118 silly build [email protected]
119 info linkStuff [email protected]
120 silly linkStuff [email protected] has /root/shell-bot/node_modules as its parent node_modules
121 silly build [email protected]
122 info linkStuff [email protected]
123 silly linkStuff [email protected] has /root/shell-bot/node_modules as its parent node_modules
124 timing action:build Completed in 1ms
125 silly doSerial global-link 28
126 silly doParallel update-linked 0
127 silly doSerial install 28
128 silly install [email protected]
129 info lifecycle [email protected]~install: [email protected]
130 silly install [email protected]
131 info lifecycle [email protected]~install: [email protected]
132 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle false
133 verbose lifecycle [email protected]~install: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/root/shell-bot/node_modules/node-pty/node_modules/.bin:/root/shell-bot/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
134 verbose lifecycle [email protected]~install: CWD: /root/shell-bot/node_modules/node-pty
135 silly lifecycle [email protected]~install: Args: [ '-c', 'node scripts/install.js' ]
136 silly lifecycle [email protected]~install: Returned: code: 1  signal: null
137 info lifecycle [email protected]~install: Failed to exec install script
138 timing action:install Completed in 80ms
139 verbose unlock done using /root/.npm/_locks/staging-08b964d67b451cf4.lock for /root/shell-bot/node_modules/.staging
140 timing stage:rollbackFailedOptional Completed in 56ms
141 timing stage:runTopLevelLifecycles Completed in 1054ms
142 silly saveTree [email protected]
142 silly saveTree ├─┬ [email protected]
142 silly saveTree │ ├── [email protected]
142 silly saveTree │ ├─┬ [email protected]
142 silly saveTree │ │ ├── [email protected]
142 silly saveTree │ │ ├─┬ [email protected]
142 silly saveTree │ │ │ └── [email protected]
142 silly saveTree │ │ └─┬ [email protected]
142 silly saveTree │ │   └── [email protected]
142 silly saveTree │ └─┬ [email protected]
142 silly saveTree │   └─┬ [email protected]
142 silly saveTree │     ├── [email protected]
142 silly saveTree │     └── [email protected]
142 silly saveTree ├── [email protected]
142 silly saveTree ├─┬ [email protected]
142 silly saveTree │ ├─┬ [email protected]
142 silly saveTree │ │ └─┬ [email protected]
142 silly saveTree │ │   └── [email protected]
142 silly saveTree │ └─┬ [email protected]
142 silly saveTree │   └── [email protected]
142 silly saveTree ├── [email protected]
142 silly saveTree ├─┬ [email protected]
142 silly saveTree │ └── [email protected]
142 silly saveTree ├── [email protected]
142 silly saveTree ├─┬ [email protected]
142 silly saveTree │ └─┬ [email protected]
142 silly saveTree │   ├── [email protected]
142 silly saveTree │   └── [email protected]
142 silly saveTree └── [email protected]
143 verbose stack Error: [email protected] install: `node scripts/install.js`
143 verbose stack Exit status 1
143 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
143 verbose stack     at EventEmitter.emit (events.js:189:13)
143 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
143 verbose stack     at ChildProcess.emit (events.js:189:13)
143 verbose stack     at maybeClose (internal/child_process.js:970:16)
143 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
144 verbose pkgid [email protected]
145 verbose cwd /root/shell-bot
146 verbose Linux 4.4.0-143-generic
147 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
148 verbose node v10.15.3
149 verbose npm  v6.4.1
150 error code ELIFECYCLE
151 error errno 1
152 error [email protected] install: `node scripts/install.js`
152 error Exit status 1
153 error Failed at the [email protected] install script.
153 error This is probably not a problem with npm. There is likely additional logging output above.
154 verbose exit [ 1, true ]

[Bug]Not working since few day

Hello,

Since few day, my bot stop working, can you help me?

`billou@billou-serveur:~/Téléchargements/Serveur/Bot Desktop/shell-bot$ shellbot innerError Error: Cannot find module '../build/Debug/pty.node'
Require stack:
- /home/billou/Téléchargements/Serveur/Bot Desktop/shell-bot/node_modules/node-pty/lib/unixTerminal.js
- /home/billou/Téléchargements/Serveur/Bot Desktop/shell-bot/node_modules/node-pty/lib/index.js
- /home/billou/Téléchargements/Serveur/Bot Desktop/shell-bot/lib/command.js
- /home/billou/Téléchargements/Serveur/Bot Desktop/shell-bot/server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/billou/Téléchargements/Serveur/Bot Desktop/shell-bot/node_modules/node-pty/lib/unixTerminal.js:30:15)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/billou/Téléchargements/Serveur/Bot Desktop/shell-bot/node_modules/node-pty/lib/unixTerminal.js',
    '/home/billou/Téléchargements/Serveur/Bot Desktop/shell-bot/node_modules/node-pty/lib/index.js',
    '/home/billou/Téléchargements/Serveur/Bot Desktop/shell-bot/lib/command.js',
    '/home/billou/Téléchargements/Serveur/Bot Desktop/shell-bot/server.js'
  ]
}
/home/billou/Téléchargements/Serveur/Bot Desktop/shell-bot/node_modules/node-pty/lib/unixTerminal.js:35
        throw outerError;
        ^

Error: libnode.so.64: cannot open shared object file: No such file or directory
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/billou/Téléchargements/Serveur/Bot Desktop/shell-bot/node_modules/node-pty/lib/unixTerminal.js:26:11)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)`

innerError Error: Cannot find module '../build/Debug/pty.node'

I am a newbie here! Excuse my ignorance!
I deployed a forked repository [https://github.com/botgram/shell-bot/] on heroku which gave me error.

[LOG]
2021-06-10T09:31:20.044424+00:00 app[worker.1]: > [email protected] start /app
2021-06-10T09:31:20.044425+00:00 app[worker.1]: > node server.js
2021-06-10T09:31:20.044425+00:00 app[worker.1]:
2021-06-10T09:31:20.209163+00:00 app[worker.1]: innerError Error: Cannot find module '../build/Debug/pty.node'
2021-06-10T09:31:20.209165+00:00 app[worker.1]: Require stack:
2021-06-10T09:31:20.209165+00:00 app[worker.1]: - /app/node_modules/node-pty/lib/unixTerminal.js
2021-06-10T09:31:20.209166+00:00 app[worker.1]: - /app/node_modules/node-pty/lib/index.js
2021-06-10T09:31:20.209166+00:00 app[worker.1]: - /app/lib/command.js
2021-06-10T09:31:20.209167+00:00 app[worker.1]: - /app/server.js
2021-06-10T09:31:20.209168+00:00 app[worker.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
2021-06-10T09:31:20.209168+00:00 app[worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:687:27)
2021-06-10T09:31:20.209168+00:00 app[worker.1]: at Module.require (internal/modules/cjs/loader.js:849:19)
2021-06-10T09:31:20.209169+00:00 app[worker.1]: at require (internal/modules/cjs/helpers.js:74:18)
2021-06-10T09:31:20.209169+00:00 app[worker.1]: at Object. (/app/node_modules/node-pty/lib/unixTerminal.js:30:15)
2021-06-10T09:31:20.209170+00:00 app[worker.1]: at Module._compile (internal/modules/cjs/loader.js:956:30)
2021-06-10T09:31:20.209170+00:00 app[worker.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
2021-06-10T09:31:20.209171+00:00 app[worker.1]: at Module.load (internal/modules/cjs/loader.js:812:32)
2021-06-10T09:31:20.209171+00:00 app[worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:724:14)
2021-06-10T09:31:20.209172+00:00 app[worker.1]: at Module.require (internal/modules/cjs/loader.js:849:19) {
2021-06-10T09:31:20.209172+00:00 app[worker.1]: code: 'MODULE_NOT_FOUND',
2021-06-10T09:31:20.209172+00:00 app[worker.1]: requireStack: [
2021-06-10T09:31:20.209173+00:00 app[worker.1]: '/app/node_modules/node-pty/lib/unixTerminal.js',
2021-06-10T09:31:20.209173+00:00 app[worker.1]: '/app/node_modules/node-pty/lib/index.js',
2021-06-10T09:31:20.209173+00:00 app[worker.1]: '/app/lib/command.js',
2021-06-10T09:31:20.209174+00:00 app[worker.1]: '/app/server.js'
2021-06-10T09:31:20.209174+00:00 app[worker.1]: ]
2021-06-10T09:31:20.209175+00:00 app[worker.1]: }
2021-06-10T09:31:20.211743+00:00 app[worker.1]: /app/node_modules/node-pty/lib/unixTerminal.js:35
2021-06-10T09:31:20.211744+00:00 app[worker.1]: throw outerError;
2021-06-10T09:31:20.211745+00:00 app[worker.1]: ^
2021-06-10T09:31:20.211745+00:00 app[worker.1]:
2021-06-10T09:31:20.211746+00:00 app[worker.1]: Error: The module '/app/node_modules/node-pty/build/Release/pty.node'
2021-06-10T09:31:20.211746+00:00 app[worker.1]: was compiled against a different Node.js version using
2021-06-10T09:31:20.211747+00:00 app[worker.1]: NODE_MODULE_VERSION 83. This version of Node.js requires
2021-06-10T09:31:20.211747+00:00 app[worker.1]: NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
2021-06-10T09:31:20.211748+00:00 app[worker.1]: the module (for instance, using npm rebuild or npm install).
2021-06-10T09:31:20.211748+00:00 app[worker.1]: at Object.Module._extensions..node (internal/modules/cjs/loader.js:1003:18)
2021-06-10T09:31:20.211748+00:00 app[worker.1]: at Module.load (internal/modules/cjs/loader.js:812:32)
2021-06-10T09:31:20.211749+00:00 app[worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:724:14)
2021-06-10T09:31:20.211749+00:00 app[worker.1]: at Module.require (internal/modules/cjs/loader.js:849:19)
2021-06-10T09:31:20.211750+00:00 app[worker.1]: at require (internal/modules/cjs/helpers.js:74:18)
2021-06-10T09:31:20.211750+00:00 app[worker.1]: at Object. (/app/node_modules/node-pty/lib/unixTerminal.js:26:11)
2021-06-10T09:31:20.211751+00:00 app[worker.1]: at Module._compile (internal/modules/cjs/loader.js:956:30)
2021-06-10T09:31:20.211751+00:00 app[worker.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
2021-06-10T09:31:20.211751+00:00 app[worker.1]: at Module.load (internal/modules/cjs/loader.js:812:32)
2021-06-10T09:31:20.211752+00:00 app[worker.1]: at Function.Module._load (internal/modules/cjs/loader.js:724:14)
2021-06-10T09:31:20.243797+00:00 app[worker.1]: npm ERR! code ELIFECYCLE
2021-06-10T09:31:20.245429+00:00 app[worker.1]: npm ERR! errno 1
2021-06-10T09:31:20.254345+00:00 app[worker.1]: npm ERR! [email protected] start: node server.js
2021-06-10T09:31:20.254586+00:00 app[worker.1]: npm ERR! Exit status 1
2021-06-10T09:31:20.254877+00:00 app[worker.1]: npm ERR!
2021-06-10T09:31:20.255141+00:00 app[worker.1]: npm ERR! Failed at the [email protected] start script.
2021-06-10T09:31:20.255413+00:00 app[worker.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-06-10T09:31:20.262637+00:00 app[worker.1]:
2021-06-10T09:31:20.262995+00:00 app[worker.1]: npm ERR! A complete log of this run can be found in:
2021-06-10T09:31:20.263254+00:00 app[worker.1]: npm ERR! /app/.npm/_logs/2021-06-10T09_31_20_256Z-debug.log
2021-06-10T09:31:24.389789+00:00 app[worker.1]: Error waiting for network: Resource temporarily unavailable
2021-06-10T09:31:26.973699+00:00 heroku[worker.1]: Starting process with command npm start
2021-06-10T09:31:27.639131+00:00 heroku[worker.1]: State changed from starting to up
2021-06-10T09:31:29.873589+00:00 heroku[worker.1]: Process exited with status 1
2021-06-10T09:31:29.947884+00:00 heroku[worker.1]: State changed from up to crashed
2021-06-10T09:31:29.684662+00:00 app[worker.1]:

Cannot read property 'SOCKET' of undefined

Hello, when I execute /run < command >, the bot will report an error. To execute another command, such as /cd, the bot works normally.

/root/shell-bot/node_modules/node-pty/lib/unixTerminal.js:269
        var handle = new Pipe(constants.SOCKET);
                                       ^

TypeError: Cannot read property 'SOCKET' of undefined
    at new PipeSocket (/root/shell-bot/node_modules/node-pty/lib/unixTerminal.js:269:40)
    at new UnixTerminal (/root/shell-bot/node_modules/node-pty/lib/unixTerminal.js:94:25)
    at Object.spawn (/root/shell-bot/node_modules/node-pty/lib/index.js:28:12)
    at new Command (/root/shell-bot/lib/command.js:22:18)
    at Bot.<anonymous> (/root/shell-bot/server.js:192:25)
    at Bot.<anonymous> (/root/shell-bot/node_modules/botgram/lib/message.js:87:22)
    at HandlerQueue.callHandler (/root/shell-bot/node_modules/botgram/lib/message.js:63:29)
    at Bot.<anonymous> (/root/shell-bot/node_modules/botgram/lib/message.js:86:43)
    at HandlerQueue.callHandler (/root/shell-bot/node_modules/botgram/lib/message.js:63:29)
    at Bot.<anonymous> (/root/shell-bot/node_modules/botgram/lib/message.js:86:43)

"node server" bahind a corporate web proxy

Hi!,
I'm getting the following error and I guess is because its trying to do a direct connection instead of using the https_proxy,

Couldn't load the configuration file, starting the wizard.

First, enter your bot API token: xxxxxxxxxx
NetworkError: Error: connect ECONNREFUSED 149.154.167.220:443

Any idea?

shell-bot keeps getting killed on its own if the output is large

I have hosted shell-bot in my vps and i have kept it running on a tmux session. Everytime i am running my task from telegram , shell-bot process is getting killed . I have to again and again log into vps and run node server to start it again and again each time making it useless .Here's the log from the bottom of the tmux session just before it ends .

at Bot.callMethod (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:102:18)
    at ReplyQueue.action (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:104:14)
    at Bot.enqueueError (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:65:12)
    at Bot.callAction (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:31:17)
    at Bot.nextAction (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:52:38)
    at Bot.enqueueError (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:68:14)                                            at ReplyQueue.callback (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:106:14)
    at handleBody (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:157:25)
    at IncomingMessage.<anonymous> (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:146:33)
    at IncomingMessage.emit (events.js:203:15)
Emitted 'error' event at:
    at EditedMessage._whenEdited (/home/ubuntu/shell/lib/utils.js:99:17)
    at EditedMessage.<anonymous> (/home/ubuntu/shell/lib/utils.js:60:12)
    at Bot.enqueueError (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:66:44)
    at ReplyQueue.callback (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:105:23)
    at handleBody (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:158:5)
    at IncomingMessage.<anonymous> (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:146:33)
    [... lines matching original stack trace ...]
    at process._tickCallback (internal/process/next_tick.js:63:19)

OS - Ubuntu 20

multi-user support (or inline mode, so it can be used in groups)

Hi, the thing is that i want to use the bot from my two telegram accounts. I would like to [either]

  • setup more than one chat_id.
  • use the bot in a group that i created with my accounts and the bot as members.

I suppose that the last one can only be done setting up inline mode.

Cheers!

node.js don´t works in Systemd

Dear,

I'm trying to put the command online: node but it does not run in Systemd. How do I permanently place the botgram automatically in the memory of the ubuntu 16 server? Can someone help me ?

Best Regards.

Disable some run commands

is there any possibility of disabling specific run commands ?

for example, I don't want to run /run rm xyz.txt

how can we achieve that ?

Random crash when the bot is not even in use

Hi, i'm seeing this messages in the terminal where i run shell-bot even though the bot is active but not in use. I always start the bot, go to telegram and issue the /status command to check that is working, and then time later, the bot stops working. This are the messages:

Error when updating: { NetworkError: getUpdates failed: Error: socket hang up
    at new NetworkError (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:20:20)
    at ClientRequest.handleResponse (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:133:24)
    at ClientRequest.callback (/home/sysadmin/.telegrambots/shell-bot/node_modules/form-data/lib/form_data.js:471:19)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at TLSSocket.socketOnEnd (_http_client.js:423:9)
    at emitNone (events.js:111:20)
    at TLSSocket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
When calling method getUpdates: { offset: 934597283, timeout: 600 }
    at Bot.callMethod (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:102:18)
    at Bot.consumeUpdates (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:201:8)
    at Bot.<anonymous> (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:219:20)
    at handleBody (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:157:25)
    at IncomingMessage.<anonymous> (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:146:33)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
  name: 'NetworkError',
  stack: 'NetworkError: getUpdates failed: Error: socket hang up\n    at new NetworkError (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:20:20)\n    at ClientRequest.handleResponse (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:133:24)\n    at ClientRequest.callback (/home/sysadmin/.telegrambots/shell-bot/node_modules/form-data/lib/form_data.js:471:19)\n    at emitOne (events.js:116:13)\n    at ClientRequest.emit (events.js:211:7)\n    at TLSSocket.socketOnEnd (_http_client.js:423:9)\n    at emitNone (events.js:111:20)\n    at TLSSocket.emit (events.js:208:7)\n    at endReadableNT (_stream_readable.js:1064:12)\n    at _combinedTickCallback (internal/process/next_tick.js:138:11)\nWhen calling method getUpdates: { offset: 934597283, timeout: 600 }\n    at Bot.callMethod (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:102:18)\n    at Bot.consumeUpdates (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:201:8)\n    at Bot.<anonymous> (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:219:20)\n    at handleBody (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:157:25)\n    at IncomingMessage.<anonymous> (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:146:33)\n    at emitNone (events.js:111:20)\n    at IncomingMessage.emit (events.js:208:7)\n    at endReadableNT (_stream_readable.js:1064:12)\n    at _combinedTickCallback (internal/process/next_tick.js:138:11)\n    at process._tickCallback (internal/process/next_tick.js:180:9)',
  message: 'getUpdates failed: Error: socket hang up',
  err: { Error: socket hang up
    at createHangUpError (_http_client.js:331:15)
    at TLSSocket.socketOnEnd (_http_client.js:423:23)
    at emitNone (events.js:111:20)
    at TLSSocket.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9) code: 'ECONNRESET' },
  req:
   { Error: When calling method getUpdates: { offset: 934597283, timeout: 600 }
    at Bot.callMethod (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:102:18)
    at Bot.consumeUpdates (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:201:8)
    at Bot.<anonymous> (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:219:20)
    at handleBody (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:157:25)
    at IncomingMessage.<anonymous> (/home/sysadmin/.telegrambots/shell-bot/node_modules/botgram/lib/bot.js:146:33)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
     method: 'getUpdates',
     parameters: { offset: 934597283, timeout: 600 },
     message: 'When calling method getUpdates: { offset: 934597283, timeout: 600 }' } }

If it is a network error i'm sure is temporary, there must be something that can be done to avoid the crash and keep the bot working.

Cheers!

alias usage

is there any way to use run command with the alias in .bashrc?

Issue submission

How to solve the process terminated by itself due to too many output characters

Error using the "node server" command in the termux

I ran the npm install command and then the node server but I get this error:

internal/fs/utils.js:220
    throw err;
    ^

Error: ENOENT: no such file or directory, open '/etc/shells'
    at Object.openSync (fs.js:440:3)
    at Object.readFileSync (fs.js:342:35)
    at getShells (/data/data/com.termux/files/home/shell-bot/lib/utils.js:154:18)
    at Object.<anonymous> (/data/data/com.termux/files/home/shell-bot/lib/utils.js:167:14)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/etc/shells'
}

Shortcut button to execute custom script

Hello, I want to add a shortcut button to the shell bot, click to run the following command:
cd / root
run ./gd.sh
I don't know what kind of code should be added to the shell bot, can you help me?

Installation broken on raspberry pi os

While installing on a raspberry pi I can't get over the following error. Can't find the repo it's trying to talk to manually either. I'm working on an otherwise fresh install of raspbian except I've got Teleframe running.

Edit: I had a few raspis running both Teleframe and shell-bot at the same time in the summer. I was trying to make another one and the install keeps failing

26 error Error while executing:
26 error /usr/bin/git ls-remote -h -t ssh://[email protected]/botgram/node-termios.git
26 error
26 error [email protected]: Permission denied (publickey).
26 error fatal: Could not read from remote repository.
26 error
26 error Please make sure you have the correct access rights
26 error and the repository exists.
26 error
26 error exited with error code: 128
27 verbose exit [ 1, true ]

userbot

is it possible to make bot as userbot so we can upload more than 50 MB ?
thanks

Error R10

2020-02-28T03:30:21.310964+00:00 heroku[web.1]: Starting process with command `npm start` 2020-02-28T03:30:23.418452+00:00 app[web.1]: 2020-02-28T03:30:23.418470+00:00 app[web.1]: > [email protected] start /app 2020-02-28T03:30:23.418470+00:00 app[web.1]: > node server.js 2020-02-28T03:30:23.418471+00:00 app[web.1]: 2020-02-28T03:30:24.329388+00:00 app[web.1]: Bot ready. 2020-02-28T03:31:21.970736+00:00 heroku[web.1]: State changed from starting to crashed 2020-02-28T03:31:21.830820+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 2020-02-28T03:31:21.831163+00:00 heroku[web.1]: Stopping process with SIGKILL 2020-02-28T03:31:21.951500+00:00 heroku[web.1]: Process exited with status 137

Getting this error

i have pushed to heroku but bot is not responding

hello;

i want to run .py in heroku, and thats why i have downloaded that file in this shell bot root folder and pushed to heroku, but when i start bot and give some commands its not responding at all.
i have edited confi.json and usd my bot token and owner id too.
so what am i missing here?

Add a /download command to the bot

It will work similar to /upload, for example:
-user sends /download message to the bot.
-bot replies something like "Waiting for you to send a file..." or "The file will be saved to /home/user (current working dir)"
-user sends the file, photo or video
-bot replies that it is downloading and if possible will show progress.

I would do it myself if i could, but i don't know how.

Best Regards!

Spam command outputs

Hello, There! First of all, I'm gonna say thank you so much for doing awesome job by creating such this wonderful idea. I really appreciate your hard work tho. But anyways, may I ask smth to you? Is it possible to remove the commands output after another output will come up? Or is it possible to edit the old output message automatically and replace it to the newer output? Thanks a bunch bro :)

Keepalive

Hi there,

After running node server for several hours I find that the connection stalls, e.g. possibly that my ISP IP has renewed.
How can shell-bot be made to be robust, maybe every 15 minutes checking for connection to telegram then if no response it can reload the node service.

Many thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.