mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 00:19:00 +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:
parent
488a1eec0c
commit
d0d663d2bb
4 changed files with 6 additions and 4 deletions
|
@ -433,7 +433,7 @@
|
|||
<value>You cannot unmute this user!</value>
|
||||
</data>
|
||||
<data name="EventEarlyNotification" xml:space="preserve">
|
||||
<value>{0}Event {1} will start <t:{2}:R>!</value>
|
||||
<value>Event "{0}" will start {1}!</value>
|
||||
</data>
|
||||
<data name="SettingsEventEarlyNotificationOffset" xml:space="preserve">
|
||||
<value>Early event start notification offset</value>
|
||||
|
|
|
@ -430,7 +430,7 @@
|
|||
<value>Я не могу вернуть из мута этого пользователя!</value>
|
||||
</data>
|
||||
<data name="EventEarlyNotification" xml:space="preserve">
|
||||
<value>{0}Событие {1} начнется <t:{2}:R>!</value>
|
||||
<value>Событие "{0}" начнется {1}!</value>
|
||||
</data>
|
||||
<data name="SettingsEventEarlyNotificationOffset" xml:space="preserve">
|
||||
<value>Офсет отправки преждевременного уведомления о начале события</value>
|
||||
|
|
|
@ -433,7 +433,7 @@
|
|||
<value>я не могу его раззамутить...</value>
|
||||
</data>
|
||||
<data name="EventEarlyNotification" xml:space="preserve">
|
||||
<value>{0}движуха {1} начнется <t:{2}:R>!</value>
|
||||
<value>движуха "{0}" начнется {1}!</value>
|
||||
</data>
|
||||
<data name="SettingsEventEarlyNotificationOffset" xml:space="preserve">
|
||||
<value>заранее пнуть в минутах до начала движухи</value>
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue