transporttycoon
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -11,2 +11,3 @@ import { PlayerPositions } from './models/PlayerPositions'; | ||
import { Economy } from './models/Economy'; | ||
import { OwnedVehicles } from './models/OwnedVehicles'; | ||
export declare class TransportTycoon { | ||
@@ -33,2 +34,3 @@ private token; | ||
getUserBusinesses(userId: string): Promise<Business>; | ||
getUserOwnedVehicles(userId: string): Promise<OwnedVehicles>; | ||
getUserFaction(userId: string): Promise<Faction>; | ||
@@ -35,0 +37,0 @@ getUserData(userId: string): Promise<UserData>; |
@@ -148,3 +148,3 @@ "use strict"; | ||
async getUserInventoryHtml(userId) { | ||
if (userId.length === 18) | ||
if ((userId.length === 18 || userId.length === 17)) | ||
userId = (await this.getUserFromDiscord(userId)).user_id.toString(); | ||
@@ -162,3 +162,3 @@ try { | ||
async getUserBusinesses(userId) { | ||
if (userId.length === 18) | ||
if ((userId.length === 18 || userId.length === 17)) | ||
userId = (await this.getUserFromDiscord(userId)).user_id.toString(); | ||
@@ -175,4 +175,17 @@ try { | ||
} | ||
async getUserOwnedVehicles(userId) { | ||
if ((userId.length === 18 || userId.length === 17)) | ||
userId = (await this.getUserFromDiscord(userId)).user_id.toString(); | ||
try { | ||
if (this.charges.checking && this.charges.count > 0) | ||
this.charges.count--; | ||
const res = await this.tycoon.get(`/ownedvehicles/${userId}`); | ||
return Promise.resolve(res.data); | ||
} | ||
catch (err) { | ||
return Promise.reject(err); | ||
} | ||
} | ||
async getUserFaction(userId) { | ||
if (userId.length === 18) | ||
if ((userId.length === 18 || userId.length === 17)) | ||
userId = (await this.getUserFromDiscord(userId)).user_id.toString(); | ||
@@ -190,3 +203,3 @@ try { | ||
async getUserData(userId) { | ||
if (userId.length === 18) | ||
if ((userId.length === 18 || userId.length === 17)) | ||
userId = (await this.getUserFromDiscord(userId)).user_id.toString(); | ||
@@ -204,3 +217,3 @@ try { | ||
async getUserDataAdvanced(userId) { | ||
if (userId.length === 18) | ||
if ((userId.length === 18 || userId.length === 17)) | ||
userId = (await this.getUserFromDiscord(userId)).user_id.toString(); | ||
@@ -207,0 +220,0 @@ try { |
{ | ||
"name": "transporttycoon", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Wrapper for the Transport Tycoon FiveM server API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
23601
725