Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezax5 committed Nov 13, 2024
1 parent d686fcf commit 699e6bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Traits/otherTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,6 @@ public function caption()

public function pathToUrl($path)
{
return strtr($this->urlFile, ['{token}' => $this->bot_token,'{url}' => $this->urlForRequest]) . $path;
return strtr($this->urlFile, ['{url}' => $this->urlForRequest,'{token}' => $this->bot_token]) . $path;
}
}
3 changes: 2 additions & 1 deletion src/telegram.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ class telegram
];

//region init
public function __construct(string $token, $urlForRequest = 'https://api.telegram.org')
public function __construct(string $token, $urlForRequest = 'https://api.telegram.org',$urlForFile = '{url}/file/bot{token}')
{

$this->urlForRequest = (string)$urlForRequest;
$this->urlFile = (string)$urlForFile;
$this->bot_token = (string)$token;
$this->clearCache();
$this->Set_data();
Expand Down

0 comments on commit 699e6bf

Please sign in to comment.