Skip to content

Commit

Permalink
fix: not start
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzaabamboo committed Jul 25, 2023
1 parent f047fed commit e13f117
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/modules/commands/discord/yomiage.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class YomiageCommand extends BaseCompoundHandler {
private http: HttpService

private speakerId = '0';
private isStarted = true;
private isStarted = false;

constructor(
moduleRef: ModuleRef,
Expand Down Expand Up @@ -121,6 +121,12 @@ export class YomiageCommand extends BaseCompoundHandler {
switch (command?.trim()) {
case 'start':
this.speakerId = speakerId;
await lastValueFrom(
this.http.post(
this.config.get('VOICEVOX_SERVER') +
`initialize_speaker?speaker=${speakerId}&skip_reinit=true`
),
);
await this.playAudio(message, 'こんにちは、ハム様のメイドです。よろしくお願いいたします');
this.isStarted = true;
return {
Expand All @@ -136,6 +142,12 @@ export class YomiageCommand extends BaseCompoundHandler {
message: 'Not started yet, type "yomiage start" first',
}
};
await lastValueFrom(
this.http.post(
this.config.get('VOICEVOX_SERVER') +
`initialize_speaker?speaker=${speakerId}&skip_reinit=true`
),
);
this.speakerId = speakerId;
await this.playAudio(message, '声の変更が完了いたしました、わたくしの新しい声はいかがでしょうか');
return {
Expand Down

0 comments on commit e13f117

Please sign in to comment.