Skip to content

Commit

Permalink
Fix empty change message on start
Browse files Browse the repository at this point in the history
  • Loading branch information
wh0o7 committed Sep 9, 2023
1 parent c413593 commit 536c9fd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions StudentsTimetable/Services/ParseService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public async Task ParseDay()
if (lesson.Name.Length < 1) count++;
else break;
}

groupInfo.Lessons.RemoveRange(0, count);
groupInfo.Lessons.Reverse();

Expand Down Expand Up @@ -199,8 +200,10 @@ public async Task ParseDay()
Console.WriteLine(e);
}
}

_ = this._botService.SendAdminMessageAsync(new SendMessageArgs(0, $"There's been a schedule change with the groups: {string.Join(',', groupUpdatedList)}"));

if (groupUpdatedList.Count != 0)
_ = this._botService.SendAdminMessageAsync(new SendMessageArgs(0,
$"There's been a schedule change with the groups: {string.Join(',', groupUpdatedList)}"));
Timetable.Clear();
Timetable.Add(new Day
{
Expand All @@ -217,7 +220,7 @@ public async Task ParseDay()
{
foreach (var user in notificationUserList)
{
_ = this._distributionService.SendDayTimetable(user) ;
_ = this._distributionService.SendDayTimetable(user);
}
this._botService.SendAdminMessageAsync(new SendMessageArgs(0,
Expand Down Expand Up @@ -344,4 +347,4 @@ public async Task UpdateTimetableTick()

Console.WriteLine("End update tick");
}
}
}

0 comments on commit 536c9fd

Please sign in to comment.