Skip to content
This repository was archived by the owner on May 24, 2025. It is now read-only.

Commit dbd081e

Browse files
committed
1.1.0
1 parent 9737752 commit dbd081e

File tree

8 files changed

+193
-293
lines changed

8 files changed

+193
-293
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Changelog
2+
3+
## 2023
4+
5+
### April
6+
7+
#### 1.1.0
8+
- Source Code Refactoring
9+
- Dependencies Switch
10+
- From `node-fetch` to `centra`
11+
- Updated README
12+
- Added `TypeScript Specials` article
13+
- Added badges
14+
- Added LICENSE
15+
- Added CHANGELOG
16+
17+
#### 1.0.0 - 1.0.3
18+
- First Release & Public Access

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 NightNutSky
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# BPAPI
2+
3+
[![NPM: Version](https://img.shields.io/npm/v/@nightnutsky/bpapi?logo=npm&style=for-the-badge)](https://www.npmjs.com/package/@nightnutsky/bpapi)
4+
[![GitHub: Stars](https://img.shields.io/github/stars/NightNutSky/bpapi?logo=github&style=for-the-badge)](https://github.com/NightNutSky/bpapi/stargazers)
5+
[![GitHub: Source Code](https://img.shields.io/badge/Source%20Code-GitHub-green?logo=github&style=for-the-badge)](https://github.com/NightNutSky/bpapi)
6+
27
BPAPI allows you to retrieve and work with information from [BDFD](https://botdesignerdiscord.com) [Public API](https://nilpointer-software.github.io/bdfd-wiki/nightly/resources/api.html) more easier.
38

49
# Install
@@ -82,6 +87,19 @@ functionTagList().then(tagList => {
8287
}
8388
});
8489
```
90+
## TypeScript Specials
91+
If you ever worked with TypeScript, then you know that you can (and sometimes must) assign types for your consts, etc.
92+
93+
If you want to work with plain BDFD Public API, for example, do request to the `api/function_list` endpoint yourself, BPAPI can help you using one of its type - `PublicAPIResponse`.\
94+
Import this type and assign it to the request's response.
95+
96+
> Original BDFD Public API's response is a bit different and contains unused or deprecated (and now unused) properties. Unlike BDFD Public API, BPAPI only shows actual and a bit modified properties for your comfort.
97+
98+
| Showcase |
99+
| :------: |
100+
| ![Showcase](https://user-images.githubusercontent.com/70456337/230720560-c425f057-d09c-4e91-8f68-8f9312d07455.png) |
101+
| ![Showcase](https://user-images.githubusercontent.com/70456337/230720600-f89d6185-ae72-47c8-ab37-cee6f1d6a9e5.png) |
102+
85103

86104
## Raw Returns
87105

package-lock.json

Lines changed: 0 additions & 227 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nightnutsky/bpapi",
3-
"version": "1.0.3",
3+
"version": "1.1.0",
44
"description": "BPAPI allows you to retrieve and work with information from BDFD Public API more easier",
55
"author": "NightNutSky",
66
"main": "dist/index.js",
@@ -20,9 +20,9 @@
2020
],
2121
"license": "MIT",
2222
"dependencies": {
23-
"node-fetch": "2.6.7"
23+
"centra": "^2.6.0"
2424
},
2525
"devDependencies": {
26-
"@types/node-fetch": "2.6.3"
26+
"@types/centra": "^2.2.0"
2727
}
2828
}

src/consts.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export const API = 'https://botdesignerdiscord.com/public/api/';
2+
export const INTENTS = Object.freeze({
3+
Members: 'Members',
4+
Presence: 'Presence',
5+
None: 'None'
6+
});
7+
export const RAW_INTENTS = Object.freeze({
8+
Members: 2,
9+
Presence: 256,
10+
None: 0
11+
});
12+
export const ENDPOINT = Object.freeze({
13+
Function: 'function',
14+
FunctionList: 'functionList',
15+
FunctionTagList: 'functionTagList'
16+
});
17+
export const ENDPOINT_PATH = Object.freeze({
18+
Function: 'function/',
19+
FunctionList: 'function_list',
20+
FunctionTagList: 'function_tag_list'
21+
});

0 commit comments

Comments
 (0)