Code Duplication    Length = 9-9 lines in 2 locations

src/plugins/admin/setNickname.php 1 location

@@ 85-93 (lines=9) @@
82
        $guild = $this->discord->guilds->get('id', $id);
83
		$member = $guild->members->get("id", $userID);
84
		$roles = $member->roles;
85
		foreach ($roles as $role) {
86
                    if(!isset($role->name)){
87
                        if(!in_array($role->name, $adminRoles, true)){
88
                            $msg = ":bangbang: You do not have the necessary roles to issue this command :bangbang:";
89
							$this->message->reply($msg);
90
							return null;
91
                        }
92
                    }
93
                }
94
95
            $member = $guild->members->get("id", $botID);
96
            $nick = (string)$data["messageString"];

src/plugins/admin/updateBot.php 1 location

@@ 85-93 (lines=9) @@
82
        $guild = $this->discord->guilds->get('id', $id);
83
		$member = $guild->members->get("id", $userID);
84
		$roles = $member->roles;
85
		foreach ($roles as $role) {
86
                    if(!isset($role->name)){
87
                        if(!in_array($role->name, $adminRoles, true)){
88
                            $msg = ":bangbang: You do not have the necessary roles to issue this command :bangbang:";
89
							$this->message->reply($msg);
90
							return null;
91
                        }
92
                    }
93
                }
94
95
            $update = updateBot($this->logger);
96
			if ($update = "1"){