Format
All checks were successful
ci / deploy (push) Successful in 3m41s
ci-build / build (1.24) (push) Successful in 9m41s

This commit is contained in:
2026-04-16 14:39:48 +02:00
parent bb3e174fb8
commit 1fe091cad7
2 changed files with 7 additions and 7 deletions

10
bot.go
View File

@@ -20,8 +20,8 @@ const (
// Quote represent a quote of the flim // Quote represent a quote of the flim
type Quote struct { type Quote struct {
Quote string `json:"quote"` Quote string `json:"quote"`
Page string `json:"page"` Page string `json:"page"`
ThumbURL string `json:"thumb_url"` ThumbURL string `json:"thumb_url"`
} }
@@ -84,7 +84,7 @@ func main() {
// Cite command // Cite command
b.Handle("/cite", func(m *tb.Message) { b.Handle("/cite", func(m *tb.Message) {
quotes, err := index.Search(m.Text) quotes, err := index.Search(m.Text)
if err != nil || len(quotes) == 0{ if err != nil || len(quotes) == 0 {
b.Send(m.Chat, "Pas de citation trouvée") b.Send(m.Chat, "Pas de citation trouvée")
return return
} }
@@ -152,9 +152,9 @@ func Update() error {
videos = append( videos = append(
videos, videos,
Quote{ Quote{
Quote: e.ChildAttr("img", "alt"), Quote: e.ChildAttr("img", "alt"),
ThumbURL: e.ChildAttr("img", "data-original"), ThumbURL: e.ChildAttr("img", "data-original"),
Page: e.ChildAttr("a", "href"), Page: e.ChildAttr("a", "href"),
}, },
) )
}) })

View File

@@ -9,8 +9,8 @@ import (
// QuoteIndex index of quotes // QuoteIndex index of quotes
type QuoteIndex struct { type QuoteIndex struct {
index bleve.Index index bleve.Index
Videos []Quote Videos []Quote
videoByPage map[string]Quote //videoByPage[youtubeKey] videoByPage map[string]Quote //videoByPage[youtubeKey]
} }