Skip to content

Grifed-source/better-connections-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Better Connections API

Better connections is a simple API for Better Connections Bot

Connection available

  • Hyakanime
  • Deezer
  • Monkeytype

Installation

  1. Clone the repository
git clone https://github.com/oriionn/better-connections-api.git
  1. Go to the project directory
cd better-connections-api
  1. Install dependencies
npm install
  1. Copy the .env.example file and rename it to .env
cp .env.example .env
  1. Edit the .env file and fill in the required fields
PORT=3000
AESKEY=zsc5MV834CLAwm6Gj47FrE23pM4buzVi7296AZ3p383M3uZVCHMYd9dWauUccEJ9Y2j8qiUikk2DG8mVB58593K524acY7qC8DivGQbknzWf3Nd227udK2UUpK9yL58w
APIKEY=gVn6vTDz4sfNR2t99Kspm8i9sd436dy4ee5M7Q3Y73Nkz7jvhzTRy226R8433cE3naydjGUsSMN5P6X2hR8cWZ336X75BnUYdQsVpzGuM99zE6F84Am7h3J8yFNSQ2TU
DB_PATH=./db.json

DEEZER_APPID=
DEEZER_SECRET=
DEEZER_REDIRECT_URI=http://localhost:3000/connections/deezer
  1. Copy db.json.example file and rename it to db.json
cp db.json.example db.json
  1. Run the server
npm start

API Documentation

GET /

Response

{
  "status": 200,
  "message": "API is running"
}

GET /getUserKey

Query parameters

Parameters Type Description
id number Discord User Id
key string API Key

Response

{
  "status": 200,
  "message": "zsc5MV834CLAwm6Gj47FrE23pM4buzVi7296AZ3p383M3uZVCHMYd9dWauUccEJ9Y2j8qiUikk2DG8mVB58593K524acY7qC8DivGQbknzWf3Nd227udK2UUpK9yL58w"
}

GET /connections

Query parameters

Parameters Type Description
id number Discord User's Id

Response

{
  "status": 200,
  "message": { "hyakanime": { "username": "user", "link": "https://hyakanime.fr/profile/user" } }
}

ALL /connections/:connection

Body parameters

Parameters Type Description
token string Better connections's user's key
PS: Other parameters can be required depending on the connection

Response

{
  "status": 200,
  "message": "OK"
}

PS: Response depending on the connection

DELETE /connections/:connection

Body parameters

Parameters Type Description
token string Better connections's user's token

Response

{
  "status": 200,
  "message": "OK"
}

GET /oauth2-link/:connection

Connection available

  • Deezer

Response

{
  "status": 200,
  "message": "(Oauth Link)"
}

Contributors

Contributors

License

GPL3

About

A simple API for Better Connections Discord Bot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 87.5%
  • EJS 12.5%