JustHumanz / Go-Simp

A simple VTuber bot which pings you or your roles if any new Videos, Fanarts, or Livestreams and Upcoming streams of VTubers are posted!
https://go-simp.humanz.moe
GNU General Public License v3.0
68 stars 13 forks source link

Add webhook for form feature #341

Open futag opened 2 years ago

futag commented 2 years ago

Continue issue https://github.com/JustHumanz/Go-Simp/issues/296, maybe add some api webhook to Vtbot discord server to easier add and change vtuber state without login to github

JustHumanz commented 2 years ago

let me think for the flow

futag commented 2 years ago

Example, when send request post api, automatic send in webhook discord

JustHumanz commented 2 years ago

yeah, it's simple but can be dangerous if someone abuses the API

anyway, any idea about the payload? should like this?

{
 "vtuber": "blabla",
 "current_state" : "Active",
 "update_state": "Inactive",
}
futag commented 2 years ago

yeah, but in 2 statement

But this playload like this

{
  "id": 1,
  "old" {
    "key": "value",
  },
  "new": {
    "key": "value"
  }
}
futag commented 2 years ago

there may be data that is deleted, data that is added, or there is also data that is changed

JustHumanz commented 2 years ago

Here for the json object request

Add

{
        "Name": "Kanochi",
        "EN_Name": "Mahoro Kano",
        "JP_Name": "鹿乃",
        "Twitter": {
            "Twitter_Fanart": "#まほろ絵",
            "Twitter_Lewd": "",
            "Twitter_Username": "kanomahoro"
        },
        "Youtube": null,
        "BiliBili": {
            "BiliBili_Fanart": "鹿乃絵",
            "BiliBili_ID": 316381099,
            "BiliRoom_ID": 15152878
        },
        "Twitch": null,
        "Region": "JP",
        "Fanbase": "",
    }

Update

{
    "ID": 14,
    "Old": {
        "Name": "Kanochi",
        "EN_Name": "Mahoro Kano",
        "JP_Name": "鹿乃",
        "Twitter": {
            "Twitter_Fanart": "#まほろ絵",
            "Twitter_Lewd": "",
            "Twitter_Username": "kanomahoro"
        },
        "Youtube": null,
        "BiliBili": {
            "BiliBili_Fanart": "鹿乃絵",
            "BiliBili_ID": 316381099,
            "BiliRoom_ID": 15152878
        },
        "Twitch": null,
        "Region": "JP",
        "Fanbase": "",
        "Status": "Active"
    },
    "New": {
        "Name": "Kanochi",
        "EN_Name": "Mahoro Kano",
        "JP_Name": "鹿乃",
        "Twitter": {
            "Twitter_Fanart": "#まほろ絵",
            "Twitter_Lewd": "",
            "Twitter_Username": "bambi2525"
        },
        "Youtube": {
            "Youtube_ID": "UCfuz6xYbYFGsWWBi3SpJI1w"
        },
        "BiliBili": {
            "BiliBili_Fanart": "鹿乃絵",
            "BiliBili_ID": 316381099,
            "BiliRoom_ID": 15152878
        },
        "Twitch": null,
        "Region": "JP",
        "Fanbase": "",
        "Status": "Active"
    }
}
futag commented 2 years ago

for add, don't include status

JustHumanz commented 2 years ago

ah yeah,sure

futag commented 2 years ago

for add only active members

JustHumanz commented 2 years ago

Webhook already deployed

Add vtuber request

Edit vtuber request

futag commented 2 years ago

Add additional do adding and change group/agency (like members)

{
  "GroupName": "a Agency",
  "Icon_URL": "https://example.jp/icon.png", // For Download and add to storage
  "GroupChannel": {
    "Youtube": [
      {
        "Youtube_ID": "UCfuz6xYbYFGsWWBi3SpJI1w",
         "Region": "EN",
      }
    ],
   "BiliBili": null
  }
}

and adding Group filed inside member webhooks (using group name or group id)

  "Name": "Kanochi",
  "EN_Name": "Mahoro Kano",
  "JP_Name": "鹿乃",
  "Group": "Independent",

or

  "Name": "Kanochi",
  "EN_Name": "Mahoro Kano",
  "JP_Name": "鹿乃",
  "Group": 10,
JustHumanz commented 2 years ago

Add & Change for group agency already added, example json :

{
    "GroupName": "ArkNET",
    "GroupIcon": "https://cdn.humanz.moe/ArkNet.png",
    "GroupChannel": {
        "Youtube": null,
        "BiliBili": null
    },
    "Members": [
        {
            "Name": "Enji_NC",
            "EN_Name": "Enji Notokunchoro",
            "JP_Name": "",
            "Twitter": {
                "Twitter_Fanart": "#Enji_Art",
                "Twitter_Lewd": "",
                "Twitter_Username": "Enji_NC"
            },
            "Youtube": {
                "Yt_ID": "UCoKQhFQUtg6H09u6fHFN1AA"
            },
            "BiliBili": null,
            "Twitch": null,
            "Region": "ID",
            "Fanbase": "",
            "Status": "Active"
        }
    ]
}

When adding agency group the member data can't be null, member data should be filled