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