Skip to content

Commit

Permalink
fix: declare config
Browse files Browse the repository at this point in the history
  • Loading branch information
SaarChaffee committed Mar 9, 2024
1 parent 2cd56db commit 3e63f16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ declare module 'koishi' {

export class HitokotoApi extends Service {
private _apiUrl: string
declare config: Config

constructor(
ctx: Context,
config: Config,
) {
super(ctx, 'hitokoto', true)
this._apiUrl = this.config.sentences ? '' : config.apiUrl ?? 'https://v1.hitokoto.cn/'
this.config = config
this._apiUrl = this.config.sentences ? '' : this.config.apiUrl ?? 'https://v1.hitokoto.cn/'
}

async getHitokoto(params: SentencesParams): Promise<HitokotoRet> {
Expand Down

0 comments on commit 3e63f16

Please sign in to comment.