@@ -23,6 +23,11 @@ class Instance extends RestClient
2323 */
2424 public $ uuid = null ;
2525 /**
26+ * Instance stores the initial received instance data
27+ * @var array
28+ */
29+ private $ instance = null ;
30+ /**
2631 * __construct
2732 *
2833 * @param string $token SinusBot auth token
@@ -31,35 +36,78 @@ class Instance extends RestClient
3136 * @param array $instance SinusBot Instance array.
3237 * @return void
3338 */
34- public function __construct ($ token , $ url , $ timeout , $ uuid )
39+ public function __construct ($ token , $ url , $ timeout , $ instance )
3540 {
3641 $ this ->token = $ token ;
3742 $ this ->url = $ url ;
3843 $ this ->timeout = $ timeout ;
39- $ this ->uuid = $ uuid ;
44+ $ this ->uuid = $ instance ['uuid ' ];
45+ $ this ->instance = $ instance ;
4046 }
4147 /**
4248 * isPlaying returns true when the instance is playing something
4349 *
44- * @param string $instanceUUID UUID of the SinusBot instance
4550 * @return boolean
4651 */
4752 public function isPlaying ()
4853 {
49- return $ this ->getStatus () ['playing ' ];
54+ return $ this ->instance ['playing ' ];
5055 }
5156
5257 /**
5358 * isRunning returns true when the instance is running
5459 *
55- * @param string $instanceUUID UUID of the SinusBot instance
5660 * @return boolean
5761 */
5862 public function isRunning ()
5963 {
60- return $ this ->getStatus () ['running ' ];
64+ return $ this ->instance ['running ' ];
6165 }
62-
66+ /**
67+ * getBackend returns the SinusBot backend (Discord, TS³)
68+ *
69+ * @return string instance backend
70+ */
71+ public function getBackend ()
72+ {
73+ return $ this ->instance ['backend ' ];
74+ }
75+ /**
76+ * getNick returns the Bot's nickname
77+ *
78+ * @return string nick
79+ */
80+ public function getNick ()
81+ {
82+ return $ this ->instance ['nick ' ];
83+ }
84+ /**
85+ * getName returns the Bot's name
86+ *
87+ * @return string name
88+ */
89+ public function getName ()
90+ {
91+ return $ this ->instance ['name ' ];
92+ }
93+ /**
94+ * getServerHost returns the Bot's server host
95+ *
96+ * @return string host
97+ */
98+ public function getServerHost ()
99+ {
100+ return $ this ->instance ['serverHost ' ];
101+ }
102+ /**
103+ * getServerPort returns the Bot's server port
104+ *
105+ * @return string port
106+ */
107+ public function getServerPort ()
108+ {
109+ return $ this ->instance ['serverPort ' ];
110+ }
63111 /**
64112 * delete deletes the instance
65113 *
0 commit comments