mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 09:09:00 +03:00
Fix wrong languages being used in some places
This commit is contained in:
parent
e3cdcbcf0c
commit
c02f503557
2 changed files with 7 additions and 0 deletions
|
@ -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))));
|
||||
|
|
|
@ -148,12 +148,14 @@ public static class Utils {
|
|||
|
||||
public static async Task DelayedUnbanAsync(CommandProcessor cmd, ulong banned, string reason, TimeSpan duration) {
|
||||
await Task.Delay(duration);
|
||||
SetCurrentLanguage(cmd.Context.Guild.Id);
|
||||
await UnbanCommand.UnbanUserAsync(cmd, banned, reason);
|
||||
}
|
||||
|
||||
public static async Task DelayedUnmuteAsync(CommandProcessor cmd, SocketGuildUser muted, string reason,
|
||||
TimeSpan duration) {
|
||||
await Task.Delay(duration);
|
||||
SetCurrentLanguage(cmd.Context.Guild.Id);
|
||||
await UnmuteCommand.UnmuteMemberAsync(cmd, muted, reason);
|
||||
}
|
||||
|
||||
|
@ -165,6 +167,7 @@ public static class Utils {
|
|||
var guild = scheduledEvent.Guild;
|
||||
if (guild.GetEvent(scheduledEvent.Id) is null) return;
|
||||
var eventConfig = Boyfriend.GetGuildConfig(guild.Id);
|
||||
SetCurrentLanguage(guild.Id);
|
||||
|
||||
var receivers = eventConfig["EventStartedReceivers"];
|
||||
var role = guild.GetRole(ulong.Parse(eventConfig["EventNotificationRole"]));
|
||||
|
|
Loading…
Reference in a new issue