Skip to content

Commit

Permalink
added badge and gamepass identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperCater committed Jul 19, 2024
1 parent aaeaecf commit 0df20a5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wrapblox",
"version": "0.4.7",
"version": "0.5.0",
"description": "A wrapper for Roblox's API",
"main": "./dist/index.js",
"module": "./dist/index.js",
Expand Down
4 changes: 4 additions & 0 deletions src/Classes/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ class User {
return await this.ownsAsset(ItemTypes.Badge, badgeId);
}

async ownsGamePass(gamePassId: number): Promise<boolean> {
return await this.ownsAsset(ItemTypes.GamePass, gamePassId);
}


async getBadgeAwardedDate(badgeId: number): Promise<Date | undefined> {
const response : AwardedBadge | undefined = await this.client.fetchHandler.fetch('GET', 'Badges', `/users/${this.id}/badges/${badgeId}/awarded-date`)
Expand Down
2 changes: 1 addition & 1 deletion src/Types/Enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export enum AvatarSize {

export enum ItemTypes {
Asset = 0,
GamePasses = 1,
GamePass = 1,
Badge = 2,
Bundle = 3,
}
2 changes: 0 additions & 2 deletions tests/user.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ test("role", async () => {
const roles = await user.fetchRoles()
const role = await roles.getRole(645836)

console.log(role)

expect(role).toBeDefined();
});

test("userLookup", async () => {
const users = await client.searchUsers("Cater")
console.log(users)
expect(users).toBeDefined();
})

Expand Down

0 comments on commit 0df20a5

Please sign in to comment.