https://github.com/icco/relay
A service that runs as a discord bot and proxies web requests to it.
https://github.com/icco/relay
Last synced: 16 days ago
JSON representation
A service that runs as a discord bot and proxies web requests to it.
- Host: GitHub
- URL: https://github.com/icco/relay
- Owner: icco
- License: mit
- Created: 2020-03-26T23:45:06.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-30T21:06:43.000Z (over 1 year ago)
- Last Synced: 2025-03-24T12:39:10.991Z (about 1 month ago)
- Language: Go
- Size: 483 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# relay
[](https://goreportcard.com/report/github.com/icco/relay)
[](https://godoc.org/github.com/icco/relay)
[](https://travis-ci.com/icco/relay)A service that runs as a discord bot and proxies web requests to it.
## Install
- Create a new app at https://discordapp.com/developers/applications, and in the app, create a bot user.
- Get the client ID from the app settings page and then visit this page to connect the bot:
- https://discordapp.com/api/oauth2/authorize?client_id=$CLIENT_ID&scope=bot&permissions=51264
- Start the app
- Send any json to `/hook`
- For example: `curl -svL -H "Content-Type: application/json" -d '{"test":"bar","hi":"xyz"}' http://localhost:8080/hook`
- It'll show up in your discord.
- [](https://icco.imgix.net/photos/2020/18afc1ec-7ea4-4e8b-88e7-f1e74786b539.png?auto=format%2Ccompress)## Expanding
Right now, all of the json types are defined in `lib/proxy.go`. If your json isn't a simple `map[string]string`, you can create a new type and add it to the file. You can see existing types in [the docs](https://godoc.org/github.com/icco/relay/lib).
Please add a test for each new type you add, so we don't break in the future.