Skip to content

Commit 76be3f5

Browse files
committed
moved logon with bot ID to the login function
1 parent 997bfe8 commit 76be3f5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/API.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ class API extends RestClient
2727
*
2828
* @param string $username SinusBot username
2929
* @param string $password SinusBot password
30+
* @param string $uuid SinusBot Bot UUID
3031
* @return boolean success
3132
*/
32-
public function login($username, $password)
33+
public function login($username, $password, $uuid = null)
3334
{
35+
$this->uuid = !$uuid?$this->getDefaultBot():$uuid;
3436
$login = $this->request('/bot/login', 'POST', [
3537
'username' => $username,
3638
'password' => $password,
@@ -456,14 +458,12 @@ public function getThumbnail($thumbnail)
456458
* __construct
457459
*
458460
* @param string $url SinusBot Bot URL
459-
* @param string $uuid SinusBot Bot UUID
460461
* @param string $timeout HTTP Timeout which is used to perform HTTP API requests
461462
* @return void
462463
*/
463-
public function __construct($url = 'http://127.0.0.1:8087', $uuid = null, $timeout = 8000)
464+
public function __construct($url = 'http://127.0.0.1:8087', $timeout = 8000)
464465
{
465466
$this->url = $url;
466467
$this->timeout = $timeout;
467-
$this->uuid = ($uuid == null) ? $this->getDefaultBot() : $uuid;
468468
}
469469
}

0 commit comments

Comments
 (0)