UNPKG

@haelp/teto

Version:

A typescript-based controllable TETR.IO client.

30 lines (29 loc) 764 B
/** * Client utils. This may be deprecated in the future */ export 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