Waaatanuki / gbf-app

gbfapp
8 stars 2 forks source link

About GBF App API #1

Open hanshino opened 1 year ago

hanshino commented 1 year ago

Hi there,

I am an GBF player, and during the events, I frequently use your hosted website. I noticed that http://gbf.pub/ doesn't seem to be included in your repositories, so I decided to create this issue to ask about it.

I am interested in developing a Discord bot to track scores, and I was wondering if it's possible to directly call your API for integration. This would greatly enhance the functionality and user experience of the bot.

User Stories and Design Plan

User Stories:

  1. As a user, I can set my ID with the bot to inquire about my current score.
  2. As a user, I can receive immediate notifications whenever my score is updated.
  3. As a user, the notifications will also include information about my ranking status.

Design Plan:

To achieve the user stories, I propose the following implementation approach:

  1. Periodic Score Query: The bot will periodically inquire about the scores, ideally every 20 minutes. This ensures that users have access to up-to-date information without overloading the server with excessive requests.

  2. Continuous Tracking for ID-based Players: For users who have set their IDs with the bot, the bot will continue querying their scores every 10 minutes to ensure that any score updates are captured promptly and accurately.

By incorporating these features, the bot will effectively assist GBF players in monitoring their scores, receive timely updates, and stay informed about their ranking status during events.

Please let me know your thoughts on this design plan, and if there are any other specific functionalities or considerations you would like to include in the bot. Your feedback is valuable in shaping the development process.

Looking forward to your response and guidance on how to proceed with accessing the GBF app API.

Thank you!

PS: I'm not good at english, so this issue is translated by ChatGPT.

hanshino commented 1 year ago

@Waaatanuki Hi, I just wanted to mention and remind you that I have raised an issue.

Waaatanuki commented 1 year ago

@Waaatanuki Hi, I just wanted to mention and remind you that I have raised an issue.

抱歉才看到。

以及一个需要确认的点:你准备从服务端还是客户端访问接口?

hanshino commented 1 year ago

首先感謝回覆

我預計會使用 server 來存取 api 我會在我這邊先做一層暫存處理,避免重複的去詢問已經知道的數據

例如:在 20 分鐘的結算週期內,有兩種情況

  1. 沒有該玩家數據,查詢並且儲存至我本地的資料庫
  2. 資料庫已有數據,直接回應玩家

註:這裡資料庫為我自己架設的資料庫


初期專案預計先完成第一個版本,正如我前一個 comment 中提到 有以下基本的功能

因此可能最一開始提供三個方法即可

  1. 正如 GM 介面中,可以透過 id角色名稱關鍵字 查出正確的帳號資訊
  2. 透過 id 查詢目前的分數
  3. jwt token 的 issue api

有以上三個方法即可完成第一版本的應用

我也預計這個專案會放在 github 中,同時會邀請你作為擁有者 這個專案預計會用 Node.js 開發,搭配 Discord.js

Waaatanuki commented 1 year ago

首先感謝回覆

我預計會使用 server 來存取 api 我會在我這邊先做一層暫存處理,避免重複的去詢問已經知道的數據

例如:在 20 分鐘的結算週期內,有兩種情況

  1. 沒有該玩家數據,查詢並且儲存至我本地的資料庫
  2. 資料庫已有數據,直接回應玩家

註:這裡資料庫為我自己架設的資料庫

初期專案預計先完成第一個版本,正如我前一個 comment 中提到 有以下基本的功能

  • 玩家可以透過機器人設定自己的遊戲 id
  • 玩家可以透過機器人詢問自己目前的分數
  • 玩家可以選擇要不要分數變動時進行通知

因此可能最一開始提供三個方法即可

  1. 正如 GM 介面中,可以透過 id角色名稱關鍵字 查出正確的帳號資訊
  2. 透過 id 查詢目前的分數
  3. jwt token 的 issue api

有以上三個方法即可完成第一版本的應用

我也預計這個專案會放在 github 中,同時會邀請你作為擁有者 這個專案預計會用 Node.js 開發,搭配 Discord.js

了解,大概有51.68%的可能性会做,到时候出文档了会联系你。