@satorijs/core
Advanced tools
Comparing version 3.3.4 to 3.4.0
{ | ||
"name": "@satorijs/core", | ||
"description": "Core components of Satorijs", | ||
"version": "3.3.4", | ||
"version": "3.4.0", | ||
"main": "lib/index.cjs", | ||
@@ -39,6 +39,7 @@ "module": "lib/index.mjs", | ||
"@cordisjs/logger": "^0.1.3", | ||
"@satorijs/element": "^2.6.1", | ||
"@cordisjs/timer": "^0.2.0", | ||
"@satorijs/element": "^3.0.0", | ||
"@satorijs/protocol": "^1.1.3", | ||
"cordis": "^3.4.1", | ||
"cordis-axios": "^4.0.1", | ||
"cordis": "^3.6.0", | ||
"cordis-axios": "^4.0.2", | ||
"cosmokit": "^1.5.2", | ||
@@ -45,0 +46,0 @@ "schemastery": "^3.14.3", |
@@ -0,1 +1,3 @@ | ||
/// <reference types="@cordisjs/timer" /> | ||
import * as cordis from 'cordis' | ||
@@ -8,2 +10,3 @@ import { Awaitable, defineProperty, Dict } from 'cosmokit' | ||
import * as logger from '@cordisjs/logger' | ||
import timer from '@cordisjs/timer' | ||
import { Event, SendOptions } from '@satorijs/protocol' | ||
@@ -146,3 +149,7 @@ import h from '@satorijs/element' | ||
super(config) | ||
this.provide('logger', undefined, true) | ||
this.provide('timer', undefined, true) | ||
this.provide('http', undefined, true) | ||
this.plugin(logger) | ||
this.plugin(timer) | ||
this.http = new Quester(config.request) | ||
@@ -149,0 +156,0 @@ } |
import { Bot } from './bot' | ||
import { Channel, Message, SendOptions } from '@satorijs/protocol' | ||
import { Message, SendOptions } from '@satorijs/protocol' | ||
import h from '@satorijs/element' | ||
@@ -17,5 +17,5 @@ import { Context } from '.' | ||
constructor(public bot: B, public channelId: string, public guildId?: string, public options: SendOptions = {}) { } | ||
constructor(public bot: B, public channelId: string, public guildId?: string, public options: SendOptions = {}) {} | ||
async prepare() { } | ||
async prepare() {} | ||
@@ -35,8 +35,6 @@ abstract flush(): Promise<void> | ||
async send(content: h.Fragment) { | ||
const isDirect = this.options.session?.isDirect ?? !this.guildId | ||
this.session = this.bot.session({ | ||
type: 'send', | ||
channel: { id: this.channelId, type: isDirect ? Channel.Type.DIRECT : Channel.Type.TEXT }, | ||
guild: { id: this.guildId }, | ||
subtype: isDirect ? 'private' : 'group', | ||
channel: { id: this.channelId, ...this.options.session?.event.channel }, | ||
guild: this.options.session?.event.guild, | ||
}) | ||
@@ -43,0 +41,0 @@ for (const key in this.options.session || {}) { |
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
105144
2198
9
+ Added@cordisjs/timer@^0.2.0
+ Added@cordisjs/timer@0.2.3(transitive)
- Removed@satorijs/element@2.6.1(transitive)
Updated@satorijs/element@^3.0.0
Updatedcordis@^3.6.0
Updatedcordis-axios@^4.0.2