@satorijs/core
Advanced tools
Comparing version 4.2.7 to 4.2.8
@@ -78,3 +78,3 @@ import { Context, Service, Logger, z } from 'cordis'; | ||
} | ||
export abstract class Bot<C extends Context = Context, T = any> implements Login { | ||
export abstract class Bot<C extends Context = Context, T = any> { | ||
ctx: C; | ||
@@ -81,0 +81,0 @@ config: T; |
{ | ||
"name": "@satorijs/core", | ||
"description": "Core components of Satorijs", | ||
"version": "4.2.7", | ||
"version": "4.2.8", | ||
"type": "module", | ||
@@ -69,4 +69,4 @@ "main": "lib/index.cjs", | ||
"cordis": "^3.18.1", | ||
"cosmokit": "^1.6.2" | ||
"cosmokit": "^1.6.3" | ||
} | ||
} |
@@ -21,3 +21,3 @@ import { clone, Dict, pick } from 'cosmokit' | ||
export abstract class Bot<C extends Context = Context, T = any> implements Login { | ||
export abstract class Bot<C extends Context = Context, T = any> { | ||
static reusable = true | ||
@@ -237,3 +237,8 @@ static MessageEncoder?: new (bot: Bot, channelId: string, guildId?: string, options?: SendOptions) => MessageEncoder | ||
toJSON(): Login { | ||
return clone(pick(this, ['platform', 'selfId', 'status', 'user', 'hidden', 'features', 'proxyUrls'])) | ||
return clone({ | ||
...pick(this, ['platform', 'selfId', 'status', 'hidden', 'features', 'proxyUrls']), | ||
// make sure `user.id` is present | ||
user: this.user.id ? this.user : undefined, | ||
adapter: this.platform, | ||
}) | ||
} | ||
@@ -240,0 +245,0 @@ |
@@ -144,3 +144,2 @@ import { Channel, Event, GuildMember, Login, Message, User } from '@satorijs/protocol' | ||
user: { id: this.selfId }, | ||
selfId: this.selfId, | ||
} as Login, | ||
@@ -147,0 +146,0 @@ ...this.event, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
118170
2450
Updatedcosmokit@^1.6.3