diff --git a/packages/core/src/bot.ts b/packages/core/src/bot.ts index b8238b8b..f5b221ed 100644 --- a/packages/core/src/bot.ts +++ b/packages/core/src/bot.ts @@ -156,8 +156,8 @@ export abstract class Bot implements Login { return messages.map(message => message.id) } - async sendPrivateMessage(userId: string, content: Fragment, options?: SendOptions) { - const { id } = await this.createDirectChannel(userId, options?.session?.guildId) + async sendPrivateMessage(userId: string, content: Fragment, guildId?: string, options?: SendOptions) { + const { id } = await this.createDirectChannel(userId, guildId ?? options?.session?.guildId) return this.sendMessage(id, content, null, options) } diff --git a/packages/protocol/src/index.ts b/packages/protocol/src/index.ts index bd0d8742..5543f56e 100644 --- a/packages/protocol/src/index.ts +++ b/packages/protocol/src/index.ts @@ -75,7 +75,7 @@ export interface List { export interface Methods { // message sendMessage(channelId: string, content: Element.Fragment, guildId?: string, options?: SendOptions): Promise - sendPrivateMessage(userId: string, content: Element.Fragment, options?: SendOptions): Promise + sendPrivateMessage(userId: string, content: Element.Fragment, guildId?: string, options?: SendOptions): Promise getMessage(channelId: string, messageId: string): Promise getMessageList(channelId: string, next?: string): Promise> getMessageIter(channelId: string): AsyncIterable @@ -228,22 +228,14 @@ export interface Button { export interface Command { name: string - aliases: string[] description: Dict - arguments: Command.Argument[] - options: Command.Option[] + arguments: Command.Declaration[] + options: Command.Declaration[] children: Command[] } export namespace Command { - export interface Argument { - name: string - description: Dict - type: string - required: boolean - } - - export interface Option { + export interface Declaration { name: string description: Dict type: string