Skip to content

Commit

Permalink
beta1 release, ci test.
Browse files Browse the repository at this point in the history
  • Loading branch information
sasagar committed May 21, 2023
1 parent 070d0e1 commit ede5bb4
Show file tree
Hide file tree
Showing 16 changed files with 3,385 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose
{
"name": "Existing Docker Compose (Extend)",

// Update the 'dockerComposeFile' list if you have more compose files or use different names.
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
"dockerComposeFile": [
"../compose.yml",
"docker-compose.yml"
],

// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
"service": "grizzco-misskey-bot",

// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}"

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line if you want start specific services in your Docker Compose config.
// "runServices": [],

// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
// "shutdownAction": "none",

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}
26 changes: 26 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3.8'
services:
# Update this to the name of the service you want to work with in your docker-compose.yml file
grizzco-misskey-bot:
# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer
# folder. Note that the path of the Dockerfile and context is relative to the *primary*
# docker-compose.yml file (the first in the devcontainer.json "dockerComposeFile"
# array). The sample below assumes your primary file is in the root of your project.
#
# build:
# context: .
# dockerfile: .devcontainer/Dockerfile

volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- ..:/workspaces:cached

# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
# cap_add:
# - SYS_PTRACE
# security_opt:
# - seccomp:unconfined

# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"

5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
npm-debug.log
Dockerfile
compose.yml
.env
3 changes: 3 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BOT_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
MISSKEY_URL=https://misskey.example.com
JSON_URL=https://api.koukun.jp/splatoon/3/schedules/coop/
24 changes: 24 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:vue/vue3-essential",
"airbnb-base",
"eslint:recommended",
"prettier"
],
"overrides": [
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"vue"
],
"rules": {
"no-console": "off",
}
}
37 changes: 37 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: grizzco-bot
on:
workflow_dispatch:
push:
# branches:
# - "main"
tags:
- 'v*'
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# - uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v3
id: meta
with:
images: ghcr.io/${{ github.repository_owner }}/grizzco-misskey-bot
flavor: |
latest=true
tags: |
type=edge,branch=main
type=semver,pattern={{ raw }}
- uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/grizzco-misskey-bot:latest
cache-to: type=inline
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
.env
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:latest
ENV NODE_ENV production
ENV TZ="Asia/Tokyo"

RUN apt update \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*

# アプリケーションディレクトリを作成する
WORKDIR /usr/src/app

COPY package*.json ./
RUN npm install

COPY . .

CMD ["node", "index.js"]
6 changes: 6 additions & 0 deletions JSON/stages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ムニ・エール海洋発電所": ":gone_fission_hydroplant:",
"アラマキ砦": ":sockeye_station:",
"シェケナダム": ":spawning_grounds:",
"難破船ドン・ブラコ": ":marooners_bay:"
}
57 changes: 57 additions & 0 deletions JSON/weapons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"ボールドマーカー": ":sploosh_o_matic:",
"スプラシューター": ":splattershot:",
"わかばシューター": ":splattershot_jr:",
"シャープマーカー": ":splash_o_matic:",
"プロモデラーMG": ":aerospray_mg:",
"N-ZAP85": ":n_zap85:",
".52ガロン": ":52gal:",
".96ガロン": ":96gal:",
"プライムシューター": ":splattershot_pro:",
"ジェットスイーパー": ":jet_squelcher:",
"スペースシューター": ":splattershot_nova:",
"L3リールガン": ":l3_nozzlenose:",
"H3リールガン": ":h3_nozzlenose:",
"ボトルガイザー": ":squeezer:",
"スプラマニューバー": ":splat_dualies:",
"スパッタリー": ":dapple_dualies:",
"クアッドホッパーブラック": ":dark_tetra_dualies:",
"ケルビン525": ":glooga_dualies:",
"デュアルスイーパー": ":dualie_squelchers:",
"ノヴァブラスター": ":luna_blaster:",
"ホットブラスター": ":blaster:",
"ロングブラスター": ":range_blaster:",
"クラッシュブラスター": ":clash_blaster:",
"ラピッドブラスター": ":rapid_blaster:",
"Rブラスターエリート": ":rapid_blaster_pro",
"スプラスピナー": ":mini_splatling:",
"バレルスピナー": ":heavy_splatling:",
"ノーチラス47": ":nautilus47:",
"クーゲルシュライバー": ":ballpoint_splatling:",
"ハイドラント": ":hydra_splatling:",
"スプラチャージャー": ":splat_charger:",
"14式竹筒銃・甲": ":banboozler14mk1:",
"ソイチューバー": ":goo_tuber:",
"スクイックリンα": ":classic_squiffer:",
"リッター4K": ":e_liter4k:",
"R-PEN/5H": ":snipewriter5h:",
"トライストリンガー": ":tri_stringer:",
"LACT-450": ":lact_450:",
"カーボンローラー": ":carbon_roller:",
"スプラローラー": ":splat_roller:",
"ヴァリアブルローラー": ":flingza_roller:",
"ダイナモローラー": ":dynamo_roller:",
"ワイドローラー": ":big_swig_roller:",
"パブロ": ":inkbrush:",
"ホクサイ": ":octobrush:",
"バケットスロッシャー": ":slosher:",
"スクリュースロッシャー": ":sloshing_machine:",
"オーバーフロッシャー": ":bloblobber:",
"エクスプロッシャー": ":explosher:",
"パラシェルター": ":splat_brella:",
"キャンピングシェルター": ":tenta_brella:",
"スパイガジェット": ":undercover_brella:",
"ドライブワイパー": ":splatana_wiper:",
"ジムワイパー": ":splatana_stamper:",
"ランダム": ":random_green:"
}
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Grizzco Misskey-bot

## What

Post Grizzco (Co-op mode of Splatoon 3 a.k.a. Salmon Run Next Wave) schedule to Misskey.

## Getting started

At any directory that specified, make `compose.yml` like below.

```yaml
services:
grizzco-misskey-bot:
image: ghcr.io/sasagar/grizzco-misskey-bot
restart: always
volumes:
- .env:/usr/src/app/.env:ro
```
Put the `.env` file at the same directory you make `compose.yml`.
You can copy `JSON` directory from this repository. It contains all stage badges and weapon badges, so you should change them if needed to meet your server's emoji reactions.
Sample `.env` file can be found at this repository as `.env.sample`.

- You should get account (that you want to note them on) API TOKEN from Misskey, and put it on the `.env` file.
- You should change MISSKEY_URL on the `.env` file too.

Then, it's time to start.

```shell
docker compose up -d
```

And you can get the note as it scheduled.

## Spec

- Usualy, the notes are send in every 2 hours. (even-numbered hour at UTC)
- Last of the shift, note would be sent in every hours with the next shift. (Last 2 hour, Last 1 hour and at the time schedule changed.)
- When BigRun detected, the information would added after the normal schedule(s).
- Now, only supports Japanese. (Of course you can contribute!)

## Spacial thanks

Schedule data: <https://koukun.jp>
6 changes: 6 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
grizzco-misskey-bot:
build: .
restart: always
volumes:
- .env:/usr/src/app/.env:ro
Loading

0 comments on commit ede5bb4

Please sign in to comment.