Skip to content

Commit

Permalink
update voice command max voice duration + clean voice command prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
fegloff committed Jan 26, 2024
1 parent 5c2adbe commit 949701a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default {
},
voiceCommand: {
isEnabled: true,
voiceDuration: 15
voiceDuration: 30
},
voiceMemo: {
isEnabled: Boolean(parseInt(process.env.VOICE_MEMO_ENABLED ?? '1')),
Expand Down
2 changes: 1 addition & 1 deletion src/modules/open-ai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class OpenAIBot implements PayableBot {

public async voiceCommand (ctx: OnMessageContext | OnCallBackQueryData, command: string, transcribedText: string): Promise<void> {
try {
let prompt = transcribedText.slice(command.length)
let prompt = transcribedText.slice(command.length).replace(/^[.,\s]+/, '')
switch (command) {
case SupportedCommands.vision: {
const photo = ctx.message?.photo ?? ctx.message?.reply_to_message?.photo
Expand Down

0 comments on commit 949701a

Please sign in to comment.