Skip to content

Commit

Permalink
added function setUrl and access url
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirmuxsin committed Nov 11, 2022
1 parent 0028fc0 commit f51072e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Laragram.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
*/
class Laragram
{
public static string $url;

/**
* @throws Exception|GuzzleException
*/
Expand Down Expand Up @@ -56,4 +58,8 @@ public static function request (string $method, array $array) {
"query" => $array[0]
])->getBody()->getContents();
}

public static function setUrl ($url) {
return self::$url = $url;
}
}
1 change: 1 addition & 0 deletions src/app/Console/Commands/longpolling.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function handle()

$this->info('Webhook address: ' . $url.config('laragram.url'));
file_get_contents("https://api.telegram.org/bot" . $token . "/setWebhook?url=" . $url.config('laragram.url'));
$setUrl = \Milly\Laragram\Laragram::setUrl($url.config('laragram.url'));
$this->info('Webhook was successfully set');
$this->call('serve');
}
Expand Down

0 comments on commit f51072e

Please sign in to comment.