Code Monkey home page Code Monkey logo

discord-ssh-bot's Introduction

Discord SSH Bot

FOSSA Status

This is a simple bot for using shell commands within Discord.

This bot does not use an actual SSH connection; it's named as such because it provides similar functionality to SSH, in that you can romotely execute commands on your computer from different devices and locations.

Setup

Only required for first run

  1. Install NodeJS if it isn't already
  2. Create a Discord bot account (if you don't know how, this guide explains the process quite well)
  3. Fill in config.json with the correct information
  4. Open a terminal in this project's root directory
  5. Run npm i to install dependencies

Usage

  1. Open a terminal in this project's root directory
  2. Run node index.js
  3. Use any shell command in the channel specified in config.json

License

FOSSA Status

discord-ssh-bot's People

Contributors

cheesits456 avatar dependabot[bot] avatar fossabot 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

Watchers

 avatar  avatar  avatar

discord-ssh-bot's Issues

Error on running

user@cloudshell:~/discord-ssh-bot$ node index.js
SyntaxError: Unexpected token , in JSON at position 87
at JSON.parse ()
at Object. (/home/user/discord-ssh-bot/script.js:6:22)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object. (/home/user/discord-ssh-bot/index.js:5:2)
at Module._compile (internal/modules/cjs/loader.js:1063:30)

Throws error on running

Whenever you use the command specified in the readme (node index.js) the application throws the following error:

2020-10-31

cd

is there any 'cd' like command? because 'cd' doesn't change the directory when i issue the command i

how to use that

i wrote all things to config ,invited the bor but it dont seeem to work

CD with bot

Would it be possible to add a feature to cd into a directory, and save that? Or is it out of the scope of this bot. Thanks in advance

Allow multiple users access

Discussed in #17

Originally posted by BeltoAlex April 30, 2021
Is there a way that I can allow multiple users to type commands into the channel?

Right now the other users can access the text channel and type messages into it, but the bot doesn't recognize their commands.

Could i add multiple ids to 'owner' in the config, or some new field to list their ids?

Error upon 'npm i' command

told me i needed to update node so i did, is the module supposed to be called server?

`internal/modules/cjs/loader.js:960
throw err;
^

Error: Cannot find module 'semver'
Require stack:

  • /usr/share/npm/lib/utils/unsupported.js
  • /usr/share/npm/bin/npm-cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
    at Function.Module._load (internal/modules/cjs/loader.js:840:27)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object. (/usr/share/npm/lib/utils/unsupported.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1019:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/usr/share/npm/lib/utils/unsupported.js',
    '/usr/share/npm/bin/npm-cli.js'
    ]
    }`

pls help

root@pk020311:~/discordbot# node index.js
node:internal/modules/cjs/loader:998
throw err;
^

Error: Cannot find module 'semver'
Require stack:

  • /root/discordbot/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Function.Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1067:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object. (/root/discordbot/index.js:1:16)
    at Module._compile (node:internal/modules/cjs/loader:1165:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
    at Module.load (node:internal/modules/cjs/loader:1043:32)
    at Function.Module._load (node:internal/modules/cjs/loader:878:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
    code: 'MODULE_NOT_FOUND',
    requireS

pls help

root@pk020311:~/discordbot# node index.js
Logged in as MinBot#4966

node:internal/errors:478
ErrorCaptureStackTrace(err);
^

TypeError [ERR_INVALID_ARG_VALUE]: The argument 'file' cannot be empty. Received ''
at new NodeError (node:internal/errors:387:5)
at normalizeSpawnArguments (node:child_process:531:11)
at spawn (node:child_process:726:13)
at exec (/root/discordbot/script.js:26:12)
at Client. (/root/discordbot/script.js:47:3)
at Client.emit (node:events:513:28)
at MessageCreateAction.handle (/root/discordbot/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/root/discordbot/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/root/discordbot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/root/discordbot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22) {
code: 'ERR_INVALID_ARG_VALUE'
}

Error: Unexpected token

When i run: node index.js : it gives out this

row@minecraft:~/sshish/discord-ssh-bot$ node index.js
/home/row/sshish/discord-ssh-bot/index.js:18
if (options?.terminal) await (await client.config.channel.fetchWebhooks()).first().send(input, {
^

SyntaxError: Unexpected token .
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
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)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3

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.