pogp lernen
This commit is contained in:
7
.idea/discord.xml
generated
Normal file
7
.idea/discord.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DiscordProjectSettings">
|
||||||
|
<option name="show" value="ASK" />
|
||||||
|
<option name="description" value="" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
72
progp/lernen/ka3/bsp_discord_server/klassen.php
Normal file
72
progp/lernen/ka3/bsp_discord_server/klassen.php
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class discord_Server{
|
||||||
|
|
||||||
|
private int $id;
|
||||||
|
public string $name;
|
||||||
|
|
||||||
|
|
||||||
|
function __construct(int $id, string $name){
|
||||||
|
$this->id = $id;
|
||||||
|
$this->name = $name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getServer(){
|
||||||
|
echo "Name: " .$this->name . "<br> ID: " . $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function beitrete():void{
|
||||||
|
// Server beitreten
|
||||||
|
}
|
||||||
|
|
||||||
|
public function verlassen():void{
|
||||||
|
// Server verlassen
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class text_channel extends discord_Server{
|
||||||
|
public int $channel_id;
|
||||||
|
public string $channel_text;
|
||||||
|
public string $channel_author;
|
||||||
|
function __construct(int $id, string $name, int $channel_id, string $channel_text, string $channel_author){
|
||||||
|
parent::__construct($id, $name);
|
||||||
|
$this->channel_id = $channel_id;
|
||||||
|
$this->channel_text = $channel_text;
|
||||||
|
$this->channel_author = $channel_author;
|
||||||
|
}
|
||||||
|
public function löschen():void{
|
||||||
|
// text channel löschen
|
||||||
|
}
|
||||||
|
public function bearbeiten():void{
|
||||||
|
// text channel bearbeiten
|
||||||
|
}
|
||||||
|
public function gettextchannel():void{
|
||||||
|
parent::getServer();
|
||||||
|
echo "<br>Text Channel ID: " . $this->channel_id;
|
||||||
|
echo "<br>Text Channel Text: " . $this->channel_text;
|
||||||
|
echo "<br>Text Channel Author: " . $this->channel_author;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class voice_channel extends discord_Server{
|
||||||
|
private int $voice_id;
|
||||||
|
public array $nutzer;
|
||||||
|
function __construct(int $id, string $name, int $voice_id, array $nutzer ){
|
||||||
|
parent::__construct($id, $name);
|
||||||
|
$this->voice_id = $voice_id;
|
||||||
|
$this->nutzer = $nutzer;
|
||||||
|
}
|
||||||
|
public function löschen():void{
|
||||||
|
// text channel löschen
|
||||||
|
}
|
||||||
|
public function bearbeiten():void{
|
||||||
|
// text channel bearbeiten
|
||||||
|
}
|
||||||
|
public function getvoicechannel():void{
|
||||||
|
parent::getServer();
|
||||||
|
echo "<br>Voice Channel ID: " . $this->voice_id;
|
||||||
|
echo "<br>Nutzer: " . var_dump($this->nutzer);
|
||||||
|
}
|
||||||
|
}
|
||||||
20
progp/lernen/ka3/bsp_discord_server/test.php
Normal file
20
progp/lernen/ka3/bsp_discord_server/test.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Grundgerüst</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Nicht Discord API</h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
require_once "klassen.php";
|
||||||
|
echo "<h2>Text Channel</h2>";
|
||||||
|
$tc = new text_channel(1, "Rasselbande", 500, "Paulaner Garten", "umisakii" );
|
||||||
|
$tc->gettextchannel();
|
||||||
|
echo "<h2>Voice Channel</h2>";
|
||||||
|
$vc = new voice_channel(1, "Rasselbande", 500, ["danielvici123", "umisakii", "Pepper(oni)"] );
|
||||||
|
$vc->getvoicechannel();
|
||||||
Reference in New Issue
Block a user