1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-01 11:39:55 +03:00

Fix a crash in scheduled event early notification (#83)

This PR fixes a fatal crash that occurs when the bot tries to send an
early notification for a scheduled event. An exception is thrown by
`string#Format` when the argument list provided doesn't match the
argument list in the template. This is fixed by correcting the template
and the argument list

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-08-12 19:18:30 +05:00 committed by GitHub
parent 488a1eec0c
commit d0d663d2bb
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 4 deletions

View file

@ -359,7 +359,9 @@ public sealed class ScheduledEventUpdateService : BackgroundService
}
var earlyResult = new EmbedBuilder()
.WithSmallTitle(string.Format(Messages.EventEarlyNotification, scheduledEvent.Name), currentUser)
.WithSmallTitle(
string.Format(Messages.EventEarlyNotification, scheduledEvent.Name,
Markdown.Timestamp(scheduledEvent.ScheduledStartTime, TimestampStyle.RelativeTime)), currentUser)
.WithColour(ColorsList.Default)
.WithCurrentTimestamp()
.Build();