diff --git a/package.json b/package.json index 1e3f0863..c3c9b88e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stoat.js", - "version": "7.3.4", + "version": "7.3.5", "type": "module", "exports": { ".": "./lib/index.js" diff --git a/src/collections/BotCollection.ts b/src/collections/BotCollection.ts index ba3f62a1..846d5cfc 100644 --- a/src/collections/BotCollection.ts +++ b/src/collections/BotCollection.ts @@ -71,10 +71,11 @@ export class BotCollection extends ClassCollection { * @returns The newly-created bot */ async createBot(name: string): Promise { - const bot = await this.client.api.post(`/bots/create`, { + const { user, ...bot } = await this.client.api.post(`/bots/create`, { name, }); + this.client.users.getOrCreate(user._id, user); return this.getOrCreate(bot._id, bot); } }