ShellBot is a Discord bot written in Go (Golang) that lets you control your VPS directly from Discord. It provides a shell-like interface, allowing you to run commands on your VPS without the need to SSH directly. As of now, it only supports Linux systems (Bash).
- Control your VPS through Discord: Use Discord commands to interact with your VPS as though you're using a shell.
- Superuser Support: Only designated superusers can execute commands on the VPS.
- Easy Setup: Get up and running quickly with the
config.yamlfile for bot configuration and ataskfile.yamlfor building the bot.
- Go 1.18+ (for building the bot)
- Linux-based VPS (the bot currently only supports Bash shells)
- Discord Bot Token (you need to create a bot on the Discord Developer Portal)
- Task (optional but recommended for building and other tasks)
git clone https://github.com/0adiy/shellbot.git
cd shellbotCreate a config.yaml file in ./bin/ dir (basically it needs to be in same folder as binary) of the repository with the following content:
prefix: "?" # The prefix to trigger the bot
token: "<Discord Bot Token>" # Your Discord bot token
superusers:
user1: "757478713402064991" # Replace with your Discord user IDs
user2: "829417226040901652" # keys (names) here don't matter but can be used for username
user3: "418364415856082953"
successEmoji: ":tickimp:1185261520842670121" # remember arrow barcket like < > are not used
rejectedEmoji: ":crossimp:1185263122827710474" # only provide custom if needed (bot should be in server where this emoji is present)- Replace
<Discord Bot Token>with your actual Discord bot token. - Replace the user IDs with the IDs of the users you want to designate as superusers (users who can execute commands).
- successEmoji and rejectedEmoji are optional but pay attention to pattern, no brackets are requried, you can get a emoji name with code by putting a
\before emoji and sending the message - The bot needs to be in the server where emojis are to use these
To build the project, make sure you have Task installed. Once that's set up, you can simply run:
task buildThis will build the bot using the provided taskfile.yaml.
Alternatively build using bash
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o ./bin/shellbot ./app/.Once you've built the bot, make it executable
chmod +x ./bin/shellbotand then you can run it with the following command:
./bin/shellbot- Go to the Discord Developer Portal and select your bot.
- Under the "OAuth2" tab, generate an invite link for your bot with the
botpermission. - Use the generated link to invite the bot to your server.
Once the bot is running, you can start sending commands from your Discord server.
Only superusers (listed in config.yaml) can run commands in shell, everyone else is ignored
-
Run a shell command:
Send a message like:
?ls -la
This will run the
ls -lacommand on your VPS and return the output in Discord.
Feel free to fork the repo, create issues, and send pull requests. If you find any bugs or have suggestions for features, let me know by creating an issue in the GitHub repository.
This project is licensed under the MIT License - see the LICENSE file for details.