Skip to content

Commit 18d643b

Browse files
committed
Add methods sendPicure and SendFile
1 parent 59a9d32 commit 18d643b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

lib/Zyberspace/Telegram/Cli/Client.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,4 +372,34 @@ public function getHistory($peer, $limit = null, $offset = null)
372372

373373
return $this->exec('history ' . $this->escapePeer($peer) . $limit . $offset);
374374
}
375+
376+
/**
377+
* Send Picture to peer
378+
*
379+
* @param string $peer The peer, gets escaped with escapePeer()
380+
* @param string $pic Picture Path
381+
* @return boolean
382+
*/
383+
public function sendPicture($peer, $pic)
384+
{
385+
$peer = $this->escapePeer($peer);
386+
$picture = $this->formatFileName($pic);
387+
388+
return $this->exec('send_photo ' . $peer . ' ' . $picture);
389+
}
390+
391+
/**
392+
* Send File to peer
393+
*
394+
* @param string $peer The peer, gets escaped with escapePeer()
395+
* @param string $pic File Path
396+
* @return boolean
397+
*/
398+
public function sendFile($peer, $file)
399+
{
400+
$peer = $this->escapePeer($peer);
401+
$atFile = $this->formatFileName($file);
402+
403+
return $this->exec('send_file ' . $peer . ' ' . $atFile);
404+
}
375405
}

0 commit comments

Comments
 (0)