You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 14, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+29-3Lines changed: 29 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,13 @@ For this example we will take the following command (execute it from the dir, wh
24
24
./bin/telegram-cli --json -dWS /tmp/tg.sck &
25
25
```
26
26
27
+
If you run the telegram-cli under another user than your php-script and you are using linux, you need to change the rights of the socket so that the php-script can access it. For example, add both to a `telegram`-group and then do
28
+
29
+
```shell
30
+
chown :telegram /tmp/tg.sck
31
+
chmod g+rwx /tmp/tg.sck
32
+
```
33
+
27
34
If you never started telegram-cli before, you need to start it first in normal mode, so you can type in your telegram-phone-number and register it, if needed (`./bin/telegram-cli`).
28
35
29
36
To stop the daemon use `killall telegram-cli` or `kill -TERM [telegram-pid]`.
@@ -32,10 +39,11 @@ To stop the daemon use `killall telegram-cli` or `kill -TERM [telegram-pid]`.
Composer will then automatically add the package to your project requirements and install it (also creates the `composer.json` if you don't have one already).
45
+
Composer will then automatically add the package to your project requirements and install it (also creates the `composer.json` if you don't have one already).
46
+
If you want to use the discovery-shell, remove the `--update-no-dev` from the command.
A really easy way to learn the api is by using the embedded [discover-shell](https://github.com/zyberspace/php-discovery-shell). You need to install the dev-dependencies for this (`composer update --dev`).
60
+
61
+
```shell
62
+
$ ./discovery-shell.php
63
+
-- discovery-shell to help discover a class or library --
64
+
65
+
Use TAB for autocompletion and your arrow-keys to navigate through your method-history.
66
+
Beware! This is not a full-featured php-shell. The input gets parsed with PHP-Parser to avoid the usage of
67
+
eval().
68
+
>$telegram->getContactList();
69
+
array(13) {
70
+
[...]
71
+
}
72
+
>$telegram->msg('my_contact', 'Hi, i am sending this from a php-client for telegram-cli.');
0 commit comments