@haelp/teto
Version:
A typescript-based controllable TETR.IO client.
38 lines (37 loc) • 906 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "ClientUtils", {
enumerable: true,
get: function() {
return ClientUtils;
}
});
class ClientUtils {
client;
/** @hideconstructor */ constructor(client){
this.client = client;
}
get api() {
return this.client.api;
}
/**
* Get the userid based on username
* @deprecated in favor of `client.social.resolve`
*/ async getID(username) {
return this.api.users.resolve(username);
}
/**
* Get a user.
* @deprecated in favor of `client.social.who`
*/ async getUser(opts) {
return this.api.users.get(opts);
}
/**
* Promise that resolves after `time` ms
*/ async sleep(time) {
return await new Promise((resolve)=>setTimeout(resolve, time));
}
}
//# sourceMappingURL=index.js.map