Предлагаю такой прикол с НГ сделать
This commit is contained in:
		
							parent
							
								
									d2623b44e5
								
							
						
					
					
						commit
						f38fca44fb
					
				@ -33,7 +33,7 @@ func HelpMessage(chatID int64) string {
 | 
				
			|||||||
		"- /ping отобью pong\n" +
 | 
							"- /ping отобью pong\n" +
 | 
				
			||||||
		"- /today_lessons покажу расписание на сегодня\n" +
 | 
							"- /today_lessons покажу расписание на сегодня\n" +
 | 
				
			||||||
		"- /tomorrow_lessons покажу расписание на завтра\n" +
 | 
							"- /tomorrow_lessons покажу расписание на завтра\n" +
 | 
				
			||||||
        "- /all_lessons - пары на несколько дней\n" +
 | 
							"- /all_lessons - пары на несколько дней\n" +
 | 
				
			||||||
		"- /weather покажу погоду у универа\n" +
 | 
							"- /weather покажу погоду у универа\n" +
 | 
				
			||||||
		"- /new_year - посчитаю количество дней до нового года\n" +
 | 
							"- /new_year - посчитаю количество дней до нового года\n" +
 | 
				
			||||||
		"\nНу а больше я пока ничего не умею" +
 | 
							"\nНу а больше я пока ничего не умею" +
 | 
				
			||||||
@ -55,7 +55,7 @@ func LessonsMessage(schedule []parser.Lesson, prefix, emptyText string) string {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	endDate := ""
 | 
						endDate := ""
 | 
				
			||||||
	for _, l := range schedule {
 | 
						for _, l := range schedule {
 | 
				
			||||||
        if endDate != l.TimeStart.Format("02.01") {
 | 
							if endDate != l.TimeStart.Format("02.01") {
 | 
				
			||||||
			if endDate != "" {
 | 
								if endDate != "" {
 | 
				
			||||||
				s += "\n"
 | 
									s += "\n"
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
@ -67,16 +67,16 @@ func LessonsMessage(schedule []parser.Lesson, prefix, emptyText string) string {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		l.Name = strings.ReplaceAll(l.Name, l.Place, "")
 | 
							l.Name = strings.ReplaceAll(l.Name, l.Place, "")
 | 
				
			||||||
		l.Name = strings.ReplaceAll(l.Name, "()", "")
 | 
							l.Name = strings.ReplaceAll(l.Name, "()", "")
 | 
				
			||||||
        l.Name = strings.ReplaceAll(l.Name, l.TimeStart.Format("15:04"), "")
 | 
							l.Name = strings.ReplaceAll(l.Name, l.TimeStart.Format("15:04"), "")
 | 
				
			||||||
		l.Name = strings.TrimSpace(l.Name)
 | 
							l.Name = strings.TrimSpace(l.Name)
 | 
				
			||||||
		s += fmt.Sprintf("%s %s (%s)\n", l.TimeMsg, l.Name, l.Place)
 | 
							s += fmt.Sprintf("%s %s (%s)\n", l.TimeMsg, l.Name, l.Place)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if prefix != "" {
 | 
						if prefix != "" {
 | 
				
			||||||
		s += "\n" +
 | 
							s += "\n" +
 | 
				
			||||||
            "Д — Димитрова 66\n" + // (Филологический, социологический)
 | 
								"Д — Димитрова 66\n" + // (Филологический, социологический)
 | 
				
			||||||
            "Л — Ленина 61\n" + // (Математический, биологический)
 | 
								"Л — Ленина 61\n" + // (Математический, биологический)
 | 
				
			||||||
            "М — Ленина 61а\n" + // (Исторический и географический)
 | 
								"М — Ленина 61а\n" + // (Исторический и географический)
 | 
				
			||||||
            "С — Социалистический 68" // (Экономический и юридический)
 | 
								"С — Социалистический 68" // (Экономический и юридический)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return s
 | 
						return s
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -105,7 +105,7 @@ func WeatherMessage(w weather.Weather) string {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func NewYearMessage(message new_year_service.NewYearMessage) string {
 | 
					func NewYearMessage(message new_year_service.NewYearMessage) string {
 | 
				
			||||||
	loc := time.FixedZone("UTC+7", +7*60*60)
 | 
						loc := time.FixedZone("UTC+7", +7*60*60)
 | 
				
			||||||
	ny := time.Date(2024, 1, 1, 0, 0, 0, 0, loc)
 | 
						ny := time.Date(time.Now().Year()+1, 1, 1, 0, 0, 0, 0, loc)
 | 
				
			||||||
	now := time.Now().In(loc)
 | 
						now := time.Now().In(loc)
 | 
				
			||||||
	days := ny.Sub(now).Hours() / 24
 | 
						days := ny.Sub(now).Hours() / 24
 | 
				
			||||||
	if message.Header != "" {
 | 
						if message.Header != "" {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user