From 0e7d7e485a92f9d528e86232e6fcf202456da979 Mon Sep 17 00:00:00 2001 From: Alexander Tumin Date: Sat, 14 May 2022 16:55:42 +0300 Subject: [PATCH] add discord bot documentation and build --- .github/workflows/go-release.yml | 24 +++++++++++++ README.jaroid.md | 58 ++++++++++++++++++++++++++++++++ README.md | 4 +++ 3 files changed, 86 insertions(+) create mode 100644 README.jaroid.md diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml index 773f3b2..7d6a749 100644 --- a/.github/workflows/go-release.yml +++ b/.github/workflows/go-release.yml @@ -28,3 +28,27 @@ jobs: disable_packaging: true overwrite: true build_flags: "-tags forceposix" + release-jaroid-matrix: + name: Release Go Binary + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + goos: [linux, windows, darwin] + goarch: ["386", amd64] + exclude: + - goarch: "386" + goos: darwin + steps: + - uses: actions/checkout@v2 + - uses: eientei/go-release-action@v1.20-nopackage-0.3 + with: + github_token: ${{ secrets.github_token }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + goversion: "https://dl.google.com/go/go1.17.1.linux-amd64.tar.gz" + project_path: "./cmd/jaroid" + binary_name: "jaroid" + disable_packaging: true + overwrite: true + build_flags: "-tags forceposix" diff --git a/README.jaroid.md b/README.jaroid.md new file mode 100644 index 0000000..a28a7b2 --- /dev/null +++ b/README.jaroid.md @@ -0,0 +1,58 @@ +This dsicord bot downloads videos from [nicovideo.jp](https://www.nicovideo.jp/), +provides color roles, role reactions and proxied pins + +USAGE +--- +Set up a discord application with bot associated https://discord.com/developers/docs/intro ; note the discord bot token. + +Run as `./jaroid -c config.yml` + +Bot implementation requires a redis server to store persistent configuration and queues + +Config +--- + +Example structure + +```yaml +private: + token: "" + prefix: "!" + redis: + address: "127.0.0.1:6379" + password: "" + db: 0 + nicovideo: + directory: "/home/somewhere/public/nicovideo" + public: "http://example.com/nicovideo" + period: "24h" + auth: + username: "" + password: "" +``` + +`!nico.download` will place files in `nicovideo.directory` and post a link using `nicovideo.public` as base, hence directory +should be served by some HTTP server. + +Example nginx configuration: +``` +server { + server_name example.com; + listen 80; + + root /home/somewhere/public/nicovideo; + + location / { + autoindex on; + } +} +``` + +Setting up a feed +--- + +``` +!nico.feed +``` + +e.g. !nico.feed cookie 1h 1234567890 クッキー☆ diff --git a/README.md b/README.md index 3f21b3a..77c1882 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,7 @@ Components: - [jaroidfedipost](README.jaroidfedipost.md) CLI utility for posting nicovideo uploads + +- [jaroid](README.jaroid.md) + + Discord bot providing same nicovideo download, API search and feeds, alongside with more conventional colored/reaction roles and proxied message pinning.