Skip to content

Commit

Permalink
Populate chat attempt message
Browse files Browse the repository at this point in the history
  • Loading branch information
adeynes committed Sep 3, 2018
1 parent 4fc16d0 commit 15c132a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/adeynes/cucumber/CucumberListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ public function onChat(PlayerChatEvent $ev)
$player = $ev->getPlayer();
$message = $ev->getMessage();

if ($this->getPlugin()->getPunishmentManager()->isMuted($player)) {
if ($mute = $this->getPlugin()->getPunishmentManager()->isMuted($player)) {
$ev->setCancelled();
$messages = $this->getPlugin()->getMessageConfig();
$player->sendMessage(MessageFactory::colorize(
$messages->getNested('moderation.mute.chat-attempt') ?? $messages->getNested('moderation.mute.mute.message')
$player->sendMessage(MessageFactory::fullFormat(
$messages->getNested('moderation.mute.chat-attempt') ?? $messages->getNested('moderation.mute.mute.message'),
$mute->getDataFormatted()
));
if ($this->log_chat) {
$this->callEvent(new ChatAttemptEvent($player, $message));
Expand Down

0 comments on commit 15c132a

Please sign in to comment.