Skip to content

Commit

Permalink
Исправлено: ссылки на .ics
Browse files Browse the repository at this point in the history
  • Loading branch information
far-galaxy committed Nov 10, 2023
1 parent c4969eb commit 2901d3f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func main() {
mainbot.WkPath = os.Getenv("WK_PATH")
mainbot.HelpTxt = string(help)
c := cron.New()
_, err = c.AddFunc("8/3 6-22 * * *", notifications)
_, err = c.AddFunc("3/5 6-22 * * *", notifications)
if err != nil {
log.Fatal(err)
}
Expand All @@ -75,7 +75,7 @@ func main() {

router := mux.NewRouter()

router.HandleFunc("/{fileNumber}.ics", site.GetICS).Methods("GET")
router.HandleFunc("/ics/{fileNumber}.ics", site.GetICS).Methods("GET")
server := &http.Server{
Addr: "localhost:8000",
Handler: router,
Expand Down
2 changes: 1 addition & 1 deletion modules/site/ics.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func GetICS(w http.ResponseWriter, r *http.Request) {
path := strings.TrimLeft(r.URL.Path, "/") // Удаление первого слэша
path := strings.TrimPrefix(r.URL.Path, "/ics/") // Удаление первого слэша

filePath := fmt.Sprintf("./shedules/ics/%s", path)

Expand Down
4 changes: 2 additions & 2 deletions modules/tg/week_shedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,9 @@ func (bot *Bot) SendICS(user *database.TgUser, id int64, query []tgbotapi.Callba
if _, err := bot.SendMsg(
user,
fmt.Sprintf(
"📖 Инструкция по установке: (в разработке)\n\n"+
"📖 Инструкция по установке: https://stud.l9labs.ru/bot/ics\n\n"+
"Ссылка для Календаря:\n"+
"https://icst.l9labs.ru/%d.ics\n\n"+
"https://stud.l9labs.ru/ics/%d.ics\n\n"+
"‼️ Файл по данной ссылке <b>не для скачивания</b> ‼️\n"+
"Иначе не будет синхронизации\n\n ",
id,
Expand Down

0 comments on commit 2901d3f

Please sign in to comment.