-
-
Notifications
You must be signed in to change notification settings - Fork 959
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various code updates and tweaks to readme and changelog
- Loading branch information
Showing
6 changed files
with
42 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -831,6 +831,22 @@ public function addCommandClasses(array $command_classes): Telegram | |
return $this; | ||
} | ||
|
||
/** | ||
* Set a single custom commands path | ||
* | ||
* @param string $path Custom commands path to set | ||
* | ||
* @return Telegram | ||
*/ | ||
public function setCommandsPath(string $path): Telegram | ||
{ | ||
$this->commands_paths = []; | ||
|
||
$this->addCommandsPath($path); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Add a single custom commands path | ||
* | ||
|
@@ -855,19 +871,17 @@ public function addCommandsPath(string $path, bool $before = true): Telegram | |
} | ||
|
||
/** | ||
* change Command folder path (other command folder about to invalid) | ||
* Set multiple custom commands paths | ||
* | ||
* @param array $paths Custom commands paths to add | ||
* | ||
* @param string $path Custom commands path | ||
* @author Wright <[email protected]> | ||
* @return Telegram | ||
*/ | ||
public function resetCommandsPaths(string $path): Telegram | ||
public function setCommandsPaths(array $paths): Telegram | ||
{ | ||
if (!is_dir($path)) { | ||
TelegramLog::error('reset commands path "' . $path . '" does not exist.'); | ||
} elseif (!in_array($path, $this->commands_paths, true)) { | ||
$this->commands_paths = [$path]; | ||
} | ||
$this->commands_paths = []; | ||
|
||
$this->addCommandsPaths($paths); | ||
|
||
return $this; | ||
} | ||
|
@@ -880,7 +894,7 @@ public function resetCommandsPaths(string $path): Telegram | |
* | ||
* @return Telegram | ||
*/ | ||
public function addCommandsPaths(array $paths, $before = true): Telegram | ||
public function addCommandsPaths(array $paths, bool $before = true): Telegram | ||
{ | ||
foreach ($paths as $path) { | ||
$this->addCommandsPath($path, $before); | ||
|
@@ -1048,7 +1062,7 @@ public function setWebhook(string $url, array $data = []): ServerResponse | |
'ip_address', | ||
'max_connections', | ||
'allowed_updates', | ||
'drop_pending_updates' | ||
'drop_pending_updates', | ||
])); | ||
$data['url'] = $url; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters