<commit_before><?php

namespace PiggyAuth\Commands;

use pocketmine\command\defaults\VanillaCommand;
use pocketmine\command\CommandSender;
use pocketmine\Player;

class SendPinCommand extends VanillaCommand {
    public function __construct($name, $plugin) {
        parent::__construct($name, "Send your pin to your email", "/sendpin");
        $this->setPermission("piggyauth.command.sendpin");
        $this->plugin = $plugin;
    }

    public function execute(CommandSender $sender, $currentAlias, array $args) {
        if (!$this->testPermission($sender)) {
            return true;
        }
        if (!$sender instanceof Player) {
            $sender->sendMessage("§cYou must use the command in-game.");
            return false;
        }
        if ($this->plugin->database->getEmail($sender->getName()) !== "none") {
            $result = $this->plugin->emailUser($this->plugin->database->getEmail($sender->getName()), $this->plugin->getMessage("email-subject-sendpin"), str_replace("{pin}", $this->plugin->database->getPin($sender->getName()), $this->plugin->getMessage("email-sendpin")));
            if ($result == "success") {
                $sender->sendMessage($this->plugin->getMessage("email-success"));
                return true;
            }
            $sender->sendMessage($this->plugin->getMessage("email-fail"));
            return false;
        }
        $sender->sendMessage($this->plugin->getMessage("no-email"));
        return true;
    }

}
<commit_msg>Fix sendpin<commit_after><?php

namespace PiggyAuth\Commands;

use pocketmine\command\defaults\VanillaCommand;
use pocketmine\command\CommandSender;
use pocketmine\Player;

class SendPinCommand extends VanillaCommand {
    public function __construct($name, $plugin) {
        parent::__construct($name, "Send your pin to your email", "/sendpin");
        $this->setPermission("piggyauth.command.sendpin");
        $this->plugin = $plugin;
    }

    public function execute(CommandSender $sender, $currentAlias, array $args) {
        if (!$this->testPermission($sender)) {
            return true;
        }
        if (!$sender instanceof Player) {
            $sender->sendMessage("§cYou must use the command in-game.");
            return false;
        }
        if ($this->plugin->database->getEmail($sender->getName()) !== "none") {
            $result = $this->plugin->emailUser($this->plugin->api, $this->plugin->domain, $this->plugin->database->getEmail($sender->getName()), $this->plugin->from, $this->plugin->getMessage("email-subject-sendpin"), str_replace("{pin}", $this->plugin->database->getPin($sender->getName()), $this->plugin->getMessage("email-sendpin")));
            if ($result == "success") {
                $sender->sendMessage($this->plugin->getMessage("email-success"));
                return true;
            }
            $sender->sendMessage($this->plugin->getMessage("email-fail"));
            return false;
        }
        $sender->sendMessage($this->plugin->getMessage("no-email"));
        return true;
    }

}

{'fraction_non_alphanumeric': 0.16677609980302036, 'fraction_numerical': 0.0, 'mean_word_length': 2.9934469200524245, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4727646', 'n_tokens_mistral': 810, 'n_tokens_neox': 819, 'n_words': 148}