credits balance also a string

This commit is contained in:
KillerBossOriginal 2023-12-07 13:10:33 +01:00
parent dda4dfd22a
commit 9ec6768b56

View file

@ -15,7 +15,7 @@ export default class CreditsManager {
* @param {number} id - The ID of the user.
* @return {Promise<number>} The balance of the user.
*/
async balance(id: number) {
async balance(id: string|number) {
let req = await axios.get(`${this.URL}/credits/${id}`);
if (req.status == 404) throw new Error("User not found");
return req.data.credits;