Skip to content

Commit

Permalink
feat: readme and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Sep 10, 2023
1 parent 60a732b commit 5079e04
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 45 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ jobs:
uses: Leomotors/auto-publish-release@main
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
title: "Bocchi Bot"
title: "Kaede Bot"
tag: ${{ github.ref }}

image:
name: Docker Image
runs-on: ubuntu-latest

permissions:
id-token: write
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -38,21 +42,21 @@ jobs:
node-version-file: ".nvmrc"
cache: pnpm

- name: Login via Azure CLI
uses: azure/login@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Azure Container Registry
uses: azure/docker-login@v1
- name: Build Docker image
uses: docker/build-push-action@v4
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build and Push Image
env:
NEXT_PUBLIC_GRAPHQL_ENDPOINT: ${{ secrets.NEXT_PUBLIC_GRAPHQL_ENDPOINT }}
run: |
docker build --build-arg NEXT_PUBLIC_GRAPHQL_ENDPOINT=$NEXT_PUBLIC_GRAPHQL_ENDPOINT . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/waifu-bot:latest
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/waifu-bot
context: .
file: Dockerfile
push: true
tags: ghcr.io/leomotors/waifu-bot:${{ github.ref_name }},ghcr.io/leomotors/waifu-bot:kaede,ghcr.io/leomotors/waifu-bot:latest
cache-from: type=gha
cache-to: type=gha,mode=max
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

Previous changelog before 4.0.605 may not be noted here.

## [4.1.700] - 2023-09-10

- feat: kaede
- refactor: Remove website and server (will write again later, maybe)
- refactor: native esm
- refactor: remove namespace
- feat: use zod for environment instead
- feat: new better docker build
- feat: public docker image at ghcr.io
- feat: /goldenframe now use goldenframe API
(No need to bundle thicc python and dangerous `exec` usage)
- feat: /goldenframe now supports animated profile picture (forceStatic)

## [4.0.662] - 2023-04-22

- chore: update docker build step
Expand Down
63 changes: 35 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,29 @@

Waifu Bot is the bot that is serving _our_ server

Current Waifu we SIMP: Bocchi-chan
Current Waifu we SIMP: <ruby>かえで<rt>Kaede</rt></ruby><ruby>姉<rt>Nee</rt></ruby> from <ruby>夢見る男子は現実主義者<rt>The Dreaming Boy is a Realist</rt></ruby>

<img src="./images/bocchitakusan.png" width=500 />
Nominated and image selected by @Qwenty228

**Current Version**: 4.0
**Been SIMPing since**: 4.0.640
![](./images/kaede.webp)

**Current Version**: 4.1
**Been SIMPing since**: 4.1.700

## 📚 Tech Stack

Coming soon

<details>
<summary>Old tech stack</summary>

My 2023 reaction: เลอะเทอะ

The most ~~over-engineered~~ advanced Discord Bot

![](./images/tech-stack.png)
![](./images/cringe-tech-stack.png)

</details>

## ✨ Features

Expand All @@ -25,41 +36,47 @@ The most ~~over-engineered~~ advanced Discord Bot

- [Golden Frame](https://github.com/Leomotors/golden-frame)!

- Using Cocoa Discord Utils and 💛JavaScript💛
- Using Cocoa Discord and 💛JavaScript💛

## 🐇 How to run the bot

### Prerequisites

- Your Discord Bot (of course)
- nodejs 18
- nodejs 18 (1s<sup>1</sup>)
- pnpm 8
- PostgreSQL Database and Public Server (VM) for Website
- Tenor API Key (not required, it works even with invalid key lol)
- [golden-frame](https://github.com/Leomotors/golden-frame) (Installable via pip, required)
- ~~PostgreSQL Database and Public Server (VM) for Website~~ not yet but might be soon
- Tenor API Key
- [Golden Frame Server](https://github.com/Leomotors/golden-frame) deployed somewhere

### Steps

- Fill in .env (see .env.example in each apps)
- `pnpm install`
- (in apps/server) `pnpm prisma migrate dev --skip-seed`
- `pnpm start` (Will start all apps at once, Turborepo will automatically build for you! If fail try again lol)
- `pnpm build`
- `pnpm start`

### Or via Docker

`docker pull ghcr.io/leomotors/waifu-bot:latest`

## Waifu Bot Archive

The Discord Bot (apps/bot) was built on top of [CarelessDev/harunon.js](https://github.com/CarelessDev/harunon.js)

Below are list of previous waifu we chose to SIMP

- **Version 4.0.605 - 4.0.629** Vergil [v4.0.629](https://github.com/leomotors/waifu-bot/tree/v4.0.629) <August 2022 - ~~No Nut~~ November 2022>
- **Version 4.0.640 - 4.0.662** Bocchi [v4.0.662-bocchi](https://github.com/Leomotors/waifu-bot/tree/v4.0.662-bocchi) &lt;November 2022 - September 2023 (11ヶ月)&gt;

- **Version 3.2 - 4.0.600** 式守さん (Shikimori-san) [v3.2](https://github.com/leomotors/waifu-bot/tree/v3.2) | [v4.0.600](https://github.com/leomotors/waifu-bot/tree/v4.0.600) <July 2022 - August 2022>
- **Version 4.0.605 - 4.0.629** Vergil [v4.0.629](https://github.com/leomotors/waifu-bot/tree/v4.0.629) &lt;August 2022 - ~~No Nut~~ November 2022 (4ヶ月)&gt;

- **Version 3.0 - 3.1** 雪ノ下陽乃 (Yukinoshita Haruno) [Repository](https://github.com/CarelessDev/harunon.js) <Mar 2022 - July 2022>
- **Version 3.2 - 4.0.600** 式守さん (Shikimori-san) [v3.2](https://github.com/leomotors/waifu-bot/tree/v3.2) | [v4.0.600](https://github.com/leomotors/waifu-bot/tree/v4.0.600) &lt;July 2022 - August 2022 (2ヶ月)&gt;

- **Version 2.0** 雪ノ下陽乃 (Yukinoshita Haruno) But it was in Python [Repository](https://github.com/CarelessDev/Harunon) <November 2021 - Mar 2022>
- **Version 3.0 - 3.1** 雪ノ下陽乃 (Yukinoshita Haruno) [Repository](https://github.com/CarelessDev/harunon.js) &lt;Mar 2022 - July 2022 (5ヶ月)&gt;

- **Version 1.0** Skittle Chan [Repository](https://github.com/CarelessDev/SIMP-Bot) <Sep 2021 - November 2021>
- **Version 2.0** 雪ノ下陽乃 (Yukinoshita Haruno) But it was in Python [Repository](https://github.com/CarelessDev/Harunon) &lt;November 2021 - Mar 2022 (5ヶ月)&gt;

- **Version 1.0** Skittle Chan [Repository](https://github.com/CarelessDev/SIMP-Bot) &lt;Sep 2021 - November 2021 (3ヶ月)&gt;

## Technical Version History

Expand All @@ -70,24 +87,14 @@ Version 4 -> Full Stack Waifu with T U R B O R E P O

## Utility Library behind this Bot!

[Cocoa Discord Utils](https://github.com/Leomotors/cocoa-discord-utils) by @Leomotors
[Cocoa Discord](https://github.com/Leomotors/cocoa-discord) by @Leomotors

![](https://c.tenor.com/JjAZAfWSqQgAAAAC/gochiusa-cocoa.gif)

**Made with 💛💛💛**

## 🖼️ Gallery

(at Version: 4.0.600)

### Client

![](./images/client-page-playlist-id-1.png)

### Bot

![](./images/bot-command-playlist-1.png)

(at version 4.0.605)

![](https://pbs.twimg.com/media/FaSN9feUYAAU3yj?format=jpg&name=large)
2 changes: 1 addition & 1 deletion apps/bot/src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ config({ path: "../../.env" });
const baseEnvSchema = z.object({
DISCORD_TOKEN: z.string().min(10),

TENOR_APIKEY: z.string().min(10).optional(),
TENOR_APIKEY: z.string().min(10),
GOLDEN_FRAME_ENDPOINT: z.string().regex(/https?:\/\/.+/),
GOLDEN_FRAME_APIKEY: z.string().min(3),
});
Expand Down
Binary file removed images/bocchitakusan.png
Binary file not shown.
Binary file removed images/bot-command-playlist-1.png
Binary file not shown.
Binary file removed images/client-page-playlist-id-1.png
Binary file not shown.
File renamed without changes
Binary file added images/kaede.webp
Binary file not shown.
Binary file removed images/vergil_reaction.jpg
Binary file not shown.

0 comments on commit 5079e04

Please sign in to comment.