Compare commits

..

No commits in common. "main" and "main" have entirely different histories.
main ... main

3 changed files with 42 additions and 47 deletions

41
LICENSE
View file

@ -1,28 +1,21 @@
BSD 3-Clause License MIT License
Copyright (c) 2025, creations.works Copyright (c) 2025 [fullname]
Redistribution and use in source and binary forms, with or without Permission is hereby granted, free of charge, to any person obtaining a copy
modification, are permitted provided that the following conditions are met: of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
1. Redistributions of source code must retain the above copyright notice, this The above copyright notice and this permission notice shall be included in all
list of conditions and the following disclaimer. copies or substantial portions of the Software.
2. Redistributions in binary form must reproduce the above copyright notice, THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
this list of conditions and the following disclaimer in the documentation IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
and/or other materials provided with the distribution. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3. Neither the name of the copyright holder nor the names of its LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
contributors may be used to endorse or promote products derived from OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
this software without specific prior written permission. SOFTWARE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -2,9 +2,6 @@
A fast Discord badge aggregation API built with [Bun](https://bun.sh) and Redis caching. A fast Discord badge aggregation API built with [Bun](https://bun.sh) and Redis caching.
# Preview
https://badges.creations.works
## Features ## Features
- Aggregates custom badge data from multiple sources (e.g. Vencord, Nekocord, Equicord, etc.) - Aggregates custom badge data from multiple sources (e.g. Vencord, Nekocord, Equicord, etc.)
@ -59,11 +56,11 @@ GET /:userId
### Query Parameters ### Query Parameters
| Name | Description | | Name | Description |
|--------------|---------------------------------------------------------------------------------------------------| |--------------|--------------------------------------------------------------------------|
| `services` | A comma or space separated list of services to fetch badges from, if this is empty it fetches all | | `services` | A comma or space separated list of services to fetch badges from |
| `cache` | Set to `true` or `false` (default: `true`). `false` bypasses Redis | | `cache` | Set to `true` or `false` (default: `true`). `false` bypasses Redis |
| `seperated` | Set to `true` to return results grouped by service, else merged array | | `seperated` | Set to `true` to return results grouped by service, else merged array |
### Supported Services ### Supported Services
@ -71,8 +68,6 @@ GET /:userId
- Equicord - Equicord
- Nekocord - Nekocord
- ReviewDb - ReviewDb
- Enmity
- Discord ( some )
### Example ### Example
@ -80,12 +75,20 @@ GET /:userId
GET /209830981060788225?seperated=true&cache=true&services=equicord GET /209830981060788225?seperated=true&cache=true&services=equicord
``` ```
## Development
Run formatting and linting with BiomeJS:
```bash
bun run lint
bun run lint:fix
```
## Start the Server ## Start the Server
```bash ```bash
bun i
bun run start bun run start
``` ```
## License ## License
[BSD 3](LICENSE) [MIT](LICENSE)

View file

@ -1,24 +1,23 @@
export const discordBadges = { export const discordBadges = {
// User badges // User badges
STAFF: 1 << 0,
PARTNER: 1 << 1,
HYPESQUAD: 1 << 2, HYPESQUAD: 1 << 2,
BUG_HUNTER_LEVEL_1: 1 << 3,
HYPESQUAD_ONLINE_HOUSE_1: 1 << 6, HYPESQUAD_ONLINE_HOUSE_1: 1 << 6,
HYPESQUAD_ONLINE_HOUSE_2: 1 << 7, HYPESQUAD_ONLINE_HOUSE_2: 1 << 7,
HYPESQUAD_ONLINE_HOUSE_3: 1 << 8, HYPESQUAD_ONLINE_HOUSE_3: 1 << 8,
PREMIUM_EARLY_SUPPORTER: 1 << 9,
TEAM_USER: 1 << 10, STAFF: 1 << 0,
SYSTEM: 1 << 12, PARTNER: 1 << 1,
BUG_HUNTER_LEVEL_2: 1 << 14,
VERIFIED_DEVELOPER: 1 << 17,
CERTIFIED_MODERATOR: 1 << 18, CERTIFIED_MODERATOR: 1 << 18,
SPAMMER: 1 << 20,
VERIFIED_DEVELOPER: 1 << 17,
ACTIVE_DEVELOPER: 1 << 22, ACTIVE_DEVELOPER: 1 << 22,
PREMIUM_EARLY_SUPPORTER: 1 << 9,
BUG_HUNTER_LEVEL_1: 1 << 3,
BUG_HUNTER_LEVEL_2: 1 << 14,
// Bot badges // Bot badges
VERIFIED_BOT: 1 << 16,
BOT_HTTP_INTERACTIONS: 1 << 19,
SUPPORTS_COMMANDS: 1 << 23, SUPPORTS_COMMANDS: 1 << 23,
USES_AUTOMOD: 1 << 24, USES_AUTOMOD: 1 << 24,
}; };