Wombat is a Discord bot that allows you to interface with services running locally on your machine from anywhere through Discord. It provides a convenient way to make HTTP requests to your local services using Discord commands.
- Make HTTP requests (GET, POST, PUT, DELETE, PATCH) to local services
- Set custom headers for requests
- Send JSON payloads in request bodies
- Parse JSON responses with JSONPath
- Formatted output for both text and JSON responses
- Clone the repository
- Create a
.env
file in the root directory and add your Discord bot token:DISCORD_BOT_TOKEN=your_token_here
- Install dependencies:
cargo build
- Run the bot:
cargo run
The bot uses the prefix ~
for commands. The main command is fetch
:
~fetch <url> [method] [headers] [body] [json_path]
url
: The URL to send the request tomethod
: (Optional) The HTTP method (GET, POST, PUT, DELETE, PATCH)headers
: (Optional) Key-value pairs for request headersbody
: (Optional) JSON payload for the request bodyjson_path
: (Optional) JSONPath selector for parsing the response
- Simple GET request:
~fetch http://localhost:3000/api/users
- GET request with custom header:
~fetch http://localhost:3000/api/users GET Authorization="Bearer token123"
- POST request with JSON body:
~fetch http://localhost:3000/api/users POST `{"name":"John Doe","email":"[email protected]"}`
- GET request with JSONPath selector:
~fetch http://localhost:3000/api/users GET $.data[0].name
- PUT request with headers and body:
~fetch http://localhost:3000/api/users/1 PUT "Content-Type"="application/json" `{"name":"Jane Doe"}`
- PATCH request with body:
~fetch http://localhost:3000/api/users/1 PATCH `{"status":"inactive"}`
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.