class Bot {
private string $token;
public function __construct(string $token) {
$this->token = $this->createUrl($token);
}
protected function createUrl(string $token) : string {
return 'https://api.telegram.org/bot' . $token;
}
public function __toString(): string
{
return $this->token;
}
}
$bot = new Bot('string');
echo $bot;