An open API service indexing awesome lists of open source software.

https://github.com/fuma-nama/discord-bot-dashboard-backend


https://github.com/fuma-nama/discord-bot-dashboard-backend

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

          

# D-Dash Backend

See the [Frontend](https://github.com/SonMooSans/discord-bot-dashboard) Repository.

Required Models for your own implementation: [models.kt](src/main/kotlin/com/bdash/api/models.kt)

# Routes

GET `login`: Redirects to oauth2 authorize url

GET `callback`: Used for oauth2 redirection

* Set encrypted cookie, and navigate the user to the dashboard home page

GET `guilds`: Fetch user guilds with additional information from bot

* Login Needed
* Returns: `Array`

GET `users/@me`: Fetch user information

* Login Needed
* Returns: `User` from [discord documentation](https://discord.com/developers/docs/resources/user#user-object)

HEAD `auth`: Check if user logged in

* Response: respond `200` if logged in, otherwise respond `401`

POST `auth/signout`: Sign out

* Login Needed
* Remove auth cookies

### ROUTE `guild/{guild}`

Login Needed

Admin Permissions of guild Needed
___
  GET: Fetch guild information with specified guild id

* Returns: `Guild`

  GET `actions`: Get actions data of the guild, won't be called if `config.data.actions` is null

* Returns: `any`, You can define your own Action Data type

  GET `features`: Get features data of the guild

* Returns: `Features`

  GET `detail`: Fetch Server Details for dashboard

* Returns `any`, You can define your own detail type

  GET `detail/advanced`: Only fetched when `config.data.dashboard` has advanced row

* Returns `any`, You can define your own advanced detail type

  GET `notification`: Get Notifications for the guild

* Returns `Array`

  GET `settings`: Get Settings of the guild

* Returns: `Settings`

  PATCH `settings`: Update Settings of the guild

* Body: `Map` updated options
* Returns: `Map` Latest options values

### ROUTE `guild/{guild}/feature/{id}`

Login Needed

Admin Permissions of guild Needed
___
  GET: Fetch Feature options

* Returns `Feature`

  PATCH: Update Feature options

* Body: `Map` updated options
* Returns: `Map` Latest options values

  PATCH `enabled`: Set feature enabled

* Response: `200` or `404` if feature doesn't exists

### ROUTE `guild/{guild}/action/{action}`

Login Needed

Admin Permissions of guild Needed
___
  GET: Get specified Action Details

* Returns: `ActionDetail`

  POST: Add new a task to Action

* Returns: `TaskDetail` Created Task details

  GET `/{task}`: Get Task details

* Returns: `ActionDetail`

  PATCH `/{task}`: Update Task details

* Body: `TaskBody`
* Returns `ActionDetail` Updated task details

  DELETE `/{task}` Delete a Task

* Response: `200` or `404` if action or task doesn't exist