Skip to content

Commit 7343da8

Browse files
committed
feat(handler): add voice indexing
1 parent f3f6bf8 commit 7343da8

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

app/bot/handler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ func makeHandlers(bot *tele.Bot, button *i18n.TemplateButton) {
1919

2020
bot.Handle(tele.OnPhoto, group.OnPhoto)
2121
bot.Handle(tele.OnVideo, group.OnVideo)
22+
bot.Handle(tele.OnVoice, group.OnVoice)
2223
bot.Handle(tele.OnDocument, group.OnDocument)
2324
bot.Handle(tele.OnAudio, group.OnAudio)
2425
bot.Handle(tele.OnAnimation, group.OnAnimation)

app/bot/internal/handler/group/on_msg.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ func OnDocument(c tele.Context) error {
2323
return index(c, c.Message().Document.FileName+" "+c.Message().Caption)
2424
}
2525

26+
func OnVoice(c tele.Context) error {
27+
return index(c, c.Message().Voice.Caption)
28+
}
29+
2630
func OnVideo(c tele.Context) error {
2731
return index(c, c.Message().Video.FileName+" "+c.Message().Caption)
2832
}

0 commit comments

Comments
 (0)