diff --git a/src/client/Client.ts b/src/client/Client.ts index 4ca2359..6b33a55 100644 --- a/src/client/Client.ts +++ b/src/client/Client.ts @@ -44,6 +44,11 @@ export default class Client extends EventEmitter { key: "users_me_" + token, }); + if (me.user.role !== "bot") + throw new Error( + `Client "${me.user.username}" is not a bot account. Contact TETR.IO Support (https://tetr.io/about/support/) to apply for a bot account.` + ); + this.me = new ClientUser(this.ws, me, await this.fetchUser(me.user._id)); await this.ws.connect(); diff --git a/src/client/ClientUser.ts b/src/client/ClientUser.ts index e92528d..4f26920 100644 --- a/src/client/ClientUser.ts +++ b/src/client/ClientUser.ts @@ -10,11 +10,6 @@ export default class ClientUser extends EventEmitter { this.ws = ws; - if (me.role !== "bot") - throw new Error( - `Client "${me.username}" is not a bot account. Contact TETR.IO Support (https://tetr.io/about/support/) to apply for a bot account.` - ); - this.user = user; this.email = me.email; this.privacy = {