X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FDiscordBotCommands%2FBaseCommand.php;h=b043af2ecd7f06da98e242381ebf3ceda3f7361f;hb=847969157063510460a48eba4bedfcce1caa7902;hp=eb3a012561c9bdc8f6e6faae8145797fff51e3be;hpb=66e57699b8055ef8a65a1be55b05301c811090bb;p=alttp.git diff --git a/app/DiscordBotCommands/BaseCommand.php b/app/DiscordBotCommands/BaseCommand.php index eb3a012..b043af2 100644 --- a/app/DiscordBotCommands/BaseCommand.php +++ b/app/DiscordBotCommands/BaseCommand.php @@ -30,6 +30,9 @@ abstract class BaseCommand { protected function __construct(Discord $discord, DiscordBotCommand $cmd) { $this->discord = $discord; $this->command = $cmd; + if ($cmd->tournament && $cmd->tournament->locale) { + App::setLocale($cmd->tournament->locale); + } } protected function fetchGuild() { @@ -40,7 +43,7 @@ abstract class BaseCommand { ->fetch($this->command->tournament->discord) ->then(function (Guild $guild) { $this->guild = $guild; - if ($guild->preferred_locale) { + if ($guild->preferred_locale && !($this->command->tournament && $this->command->tournament->locale)) { App::setLocale($guild->preferred_locale); } return $guild;