Skip to content

Commit

Permalink
5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kitosight committed Jan 25, 2025
1 parent 895727b commit 720e546
Show file tree
Hide file tree
Showing 11 changed files with 905 additions and 932 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vscode
node_modules
dist
packs
types
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
src
packs
.vscode
56 changes: 36 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,58 @@
# Changelog

## 2025

### January

#### 5.0.0

- Rewrite
- Removed Nodes Endpoint
- Added New READ ME

## 2024

### January

#### 4.0.0
- Source Code Refactoring

- Source Code Refactoring

## 2023

### July

#### 3.0.0

> Breaking Changes
- Package Renamed
- Source Code Refactoring
- Implemented Nodes Endpoint
- Updated README
- Package Renamed
- Source Code Refactoring
- Implemented Nodes Endpoint
- Updated README

### April

#### 2.0.0
- Source Code Refactoring
- Implemented Callbacks Endpoint
- Updated README
- Updated style
- Updated `TypeScript Specials` article
- Updated examples

- Source Code Refactoring
- Implemented Callbacks Endpoint
- Updated README
- Updated style
- Updated `TypeScript Specials` article
- Updated examples

#### 1.1.0
- Source Code Refactoring
- Dependencies Switch
- From `node-fetch` to `centra`
- Updated README
- Added `TypeScript Specials` article
- Added badges
- Added LICENSE
- Added CHANGELOG

- Source Code Refactoring
- Dependencies Switch
- From `node-fetch` to `centra`
- Updated README
- Added `TypeScript Specials` article
- Added badges
- Added LICENSE
- Added CHANGELOG

#### 1.0.0 - 1.0.3
- First Release & Public Access

- First Release & Public Access
240 changes: 239 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,239 @@
The old README was deleted. The new one coming soon...
> [!NOTE]
> This is the fifth iteration of the package.
The code base was fully rewritten from scratch, and support for Nodes endpoint was removed due to compatibility issues in some bundled projects caused by jsdom, replacement of which I could not find.

Anyways, here are quick examples of using the new version, breaking changes are applied for it, but responses remain the same.

# Examples

Of course, you have to import the wrapper first:
```ts
import { Wrapper } from "@synthexia/bpapi-wrapper";
```

## Function Info Endpoint

```ts
new Wrapper("function")
.function("info", "$addS")
.then((info) => {
// Work with the response
})
.catch((r) => {
// Catch an error
});
```

```json
{
"tag": "$addSelectMenuOption[Menu option ID;Label;Value;Description;(Default;Emoji;Message ID)]",
"description": "Adds select menu option to a select menu. Check wiki for examples.",
"args": [
{
"name": "Menu option ID",
"type": "String",
"required": true
},
{
"name": "Label",
"type": "String",
"required": true
},
{
"name": "Value",
"type": "String",
"required": true
},
{
"name": "Description",
"type": "String",
"required": true,
"empty": true
},
{
"name": "Default",
"type": "Bool",
"required": false,
"empty": true
},
{
"name": "Emoji",
"type": "Emoji",
"required": false,
"empty": true
},
{
"name": "Message ID",
"type": "String",
"required": false,
"empty": true
}
],
"intents": "None",
"premium": false
}
```

## Callback List Endpoint

```ts
new Wrapper("callback")
.callback("list")
.then((list) => {
// Work with the response
})
.catch((r) => {
// Catch an error
});
```

```json
[
{
"name": "$onJoined[channel ID]",
"description": "Triggers command when user joins server",
"args": [
{
"name": "Channel ID",
"description": "Channel ID of the welcome channel",
"type": "Snowflake",
"required": true
}
],
"intents": "Members",
"premium": false
},
{
"name": "$onLeave[channel ID]",
"description": "Triggers command when user leaves server",
"args": [
{
"name": "Channel ID",
"description": "Channel ID of the leave channel",
"type": "Snowflake",
"required": true
}
],
"intents": "Members",
"premium": false
},
{
"name": "$onMessageDelete[channel ID]",
"description": "Triggers command when user deletes message",
"args": [
{
"name": "Channel ID",
"description": "Channel ID of the log channel",
"type": "Snowflake",
"required": true
}
],
"intents": "None",
"premium": false
},
{
"name": "$onBanAdd[channel ID]",
"description": "Triggers command when user is banned from the server",
"args": [
{
"name": "Channel ID",
"description": "Channel ID of the log channel",
"type": "Snowflake",
"required": true
}
],
"intents": "None",
"premium": false
},
{
"name": "$onBanRemove[channel ID]",
"description": "Triggers command when user is unbanned from the server",
"args": [
{
"name": "Channel ID",
"description": "Channel ID of the log channel",
"type": "Snowflake",
"required": true
}
],
"intents": "None",
"premium": false
},
{
"name": "$alwaysReply",
"description": "Makes command get triggered by every message",
"args": [],
"intents": "None",
"premium": true
},
{
"name": "$messageContains[word;...]",
"description": "Command gets triggered every time message contains one of the provided words",
"args": [
{
"name": "Word",
"type": "String",
"required": true
}
],
"intents": "None",
"premium": true
},
{
"name": "$awaitedCommand[name;(filter)]",
"description": "Used for awaited functions.",
"args": [
{
"name": "Name",
"description": "Awaited command name",
"type": "String",
"required": true
},
{
"name": "Filter",
"description": "Awaited command filter",
"type": "String",
"required": false
}
],
"intents": "None",
"premium": false
},
{
"name": "$reaction[name]",
"description": "Used for awaited reactions.",
"args": [
{
"name": "Name",
"description": "Awaited reaction name",
"type": "String",
"required": true
}
],
"intents": "None",
"premium": true
},
{
"name": "$onInteraction[custom ID]",
"description": "Triggered by a component interaction. For example: a user pressing a button",
"args": [
{
"name": "Custom ID",
"description": "Custom ID assigned to that interaction",
"type": "String",
"required": true
}
],
"intents": "None",
"premium": false
},
{
"name": "$onInteraction",
"description": "Triggered by a component interaction. For example: a user pressing a button",
"args": [],
"intents": "None",
"premium": false
}
]
```
58 changes: 30 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
{
"name": "@synthexia/bpapi-wrapper",
"version": "4.0.1",
"description": "BPAPI Wrapper allows you to work with BDFD Public API more easier and pretty!",
"author": "Kitomanari",
"main": "./dist/index.js",
"typings": "./types/",
"repository": {
"url": "https://github.com/synthexia/bpapi-wrapper"
},
"scripts": {
"build": "tsc -p . && pnpm pack"
},
"keywords": [
"bds",
"bdscript",
"bdfd",
"bpapi"
],
"license": "MIT",
"dependencies": {
"centra": "^2.6.0",
"jsdom": "^24.0.0"
},
"devDependencies": {
"@types/centra": "^2.2.3",
"@types/jsdom": "^21.1.6"
},
"packageManager": "pnpm@8.14.1"
"name": "@synthexia/bpapi-wrapper",
"version": "5.0.0",
"description": "BPAPI Wrapper allows you to work with BDFD Public API more easier and pretty!",
"author": {
"name": "Kitosight",
"url": "https://github.com/Kitosight"
},
"main": "./dist/index.js",
"typings": "./types/",
"repository": {
"url": "https://github.com/synthexia/bpapi-wrapper"
},
"scripts": {
"build": "tsc -p . && pnpm pack --pack-destination packs"
},
"keywords": [
"bds",
"bdscript",
"bdfd",
"bpapi"
],
"license": "MIT",
"dependencies": {
"centra": "^2.7.0"
},
"devDependencies": {
"@types/centra": "^2.2.3",
"@types/node": "^22.10.7"
},
"packageManager": "pnpm@8.15.9+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81"
}
Loading

0 comments on commit 720e546

Please sign in to comment.