DiscordCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A execute() 0 6 1
1
<?php
2
/**
3
 * Copyright (c) 2018 VectorNetworkProject. All rights reserved. MIT license.
4
 *
5
 * GitHub: https://github.com/VectorNetworkProject/TheMix
6
 * Website: https://www.vector-network.tk
7
 */
8
9
namespace VectorNetworkProject\TheMix\command\defaults;
10
11
use pocketmine\command\CommandSender;
12
use pocketmine\command\PluginCommand;
13
use pocketmine\plugin\Plugin;
14
use VectorNetworkProject\TheMix\command\Permissions;
15
16
class DiscordCommand extends PluginCommand
17
{
18
    /**
19
     * DiscordCommand constructor.
20
     *
21
     * @param Plugin $owner
22
     */
23
    public function __construct(Plugin $owner)
24
    {
25
        parent::__construct('discord', $owner);
26
        $this->setDescription('Discordの招待リンクを送信します。');
27
        $this->setPermission(Permissions::USER.'discord');
28
    }
29
30
    /**
31
     * @param CommandSender $sender
32
     * @param string        $commandLabel
33
     * @param array         $args
34
     *
35
     * @return bool|mixed
36
     */
37
    public function execute(CommandSender $sender, string $commandLabel, array $args)
38
    {
39
        $sender->sendMessage('§9Discord: https://discord.gg/EF2G5dh');
40
41
        return true;
42
    }
43
}
44