1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-04 13:06:29 +03:00

Fix wrong languages being used in some places

This commit is contained in:
Octol1ttle 2022-11-20 20:45:07 +05:00
parent e3cdcbcf0c
commit c02f503557
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
2 changed files with 7 additions and 0 deletions

View file

@ -110,6 +110,7 @@ public static class EventHandler {
var guild = scheduledEvent.Guild;
var eventConfig = Boyfriend.GetGuildConfig(guild.Id);
var channel = Utils.GetEventNotificationChannel(guild);
Utils.SetCurrentLanguage(guild.Id);
if (channel is not null) {
var role = guild.GetRole(ulong.Parse(eventConfig["EventNotificationRole"]));
@ -137,6 +138,7 @@ public static class EventHandler {
var guild = scheduledEvent.Guild;
var eventConfig = Boyfriend.GetGuildConfig(guild.Id);
var channel = Utils.GetEventNotificationChannel(guild);
Utils.SetCurrentLanguage(guild.Id);
if (channel is not null)
await channel.SendMessageAsync(string.Format(Messages.EventCancelled, Utils.Wrap(scheduledEvent.Name),
eventConfig["FrowningFace"] is "true" ? $" {Messages.SettingsFrowningFace}" : ""));
@ -146,6 +148,7 @@ public static class EventHandler {
var guild = scheduledEvent.Guild;
var eventConfig = Boyfriend.GetGuildConfig(guild.Id);
var channel = Utils.GetEventNotificationChannel(guild);
Utils.SetCurrentLanguage(guild.Id);
if (channel is not null) {
var receivers = eventConfig["EventStartedReceivers"];
@ -167,6 +170,7 @@ public static class EventHandler {
private static async Task ScheduledEventCompletedEvent(SocketGuildEvent scheduledEvent) {
var guild = scheduledEvent.Guild;
var channel = Utils.GetEventNotificationChannel(guild);
Utils.SetCurrentLanguage(guild.Id);
if (channel is not null)
await channel.SendMessageAsync(string.Format(Messages.EventCompleted, Utils.Wrap(scheduledEvent.Name),
Utils.GetHumanizedTimeOffset(DateTimeOffset.Now.Subtract(scheduledEvent.StartTime))));