Skip to content

Commit

Permalink
update interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Oct 20, 2023
1 parent fe36184 commit ef50f6f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
13 changes: 8 additions & 5 deletions src/Interfaces/SettingInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ public function getEndKeyboard(string $platform, ?string $parentEvent = null): a
*
* @param string|null $callback
* @param string|null $platform
* @param string|null $platformFile
*
* @return void
* @throws InvalidViewTemplateException
* @see EventSettingTrait::eventHandle()
*/
public function eventHandle(?string $callback = null, ?string $platform = null): void;
public function eventHandle(?string $callback = null, ?string $platform = null, string $platformFile = null): void;
/**
* Get the platform from callback
*
Expand Down Expand Up @@ -123,24 +124,26 @@ public function handleEventWithActions(
*
* @param string $event
* @param string $platform
* @param string|null $platFormFile
*
* @return void
* @see EventSettingTrait::handleEventUpdate()
* @throws InvalidViewTemplateException
* @see EventSettingTrait::handleEventUpdate()
*/
public function handleEventUpdate(string $event, string $platform): void;
public function handleEventUpdate(string $event, string $platform, string $platFormFile = null): void;

/**
* Handle event update
*
* @param string $event
* @param string $platform
* @param string|null $platFormFile
*
* @return void
* @see EventSettingTrait::eventUpdateHandle()
* @throws InvalidViewTemplateException
* @see EventSettingTrait::eventUpdateHandle()
*/
public function eventUpdateHandle(string $event, string $platform): void;
public function eventUpdateHandle(string $event, string $platform, string $platFormFile = null): void;

/**
* Send a setting message
Expand Down
4 changes: 2 additions & 2 deletions src/Interfaces/Structures/AppInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ public function sendMessage(
* Send a photo to telegram
*
* @param string $photo (path to photo)
* @param string $caption
* @param array $caption
*
* @return void
* @throws EntryNotFoundException
* @see App::sendPhoto()
*/
public function sendPhoto(string $photo = '', string $caption = ''): void;
public function sendPhoto(string $photo = '', array $caption = []): void;

/**
* Send callback response to telegram (show alert)
Expand Down
5 changes: 3 additions & 2 deletions src/Structures/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,16 @@ public function sendMessage(string $message = '', array $options = []): void
$this->telegram->sendMessage($content);
}

public function sendPhoto(string $photo = '', string $caption = ''): void
public function sendPhoto(string $photo = '', array $options = []): void
{
if (empty($photo)) {
throw EntryNotFoundException::fileNotFound();
}

$content = $this->createTelegramBaseContent();
$content['photo'] = curl_file_create($photo);
$content['caption'] = $caption;

$content = $content + $options;

$this->telegram->sendPhoto($content);
}
Expand Down

0 comments on commit ef50f6f

Please sign in to comment.