Skip to content

Commit

Permalink
Adicionado método on e correções em alguns getters.
Browse files Browse the repository at this point in the history
  • Loading branch information
httd1 committed Apr 27, 2024
1 parent 7c731ce commit 6a25373
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 72 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,20 @@ class LogCommands {
]);
```

## Tipo de Update
É possível executar uma função/método para um tipo de [Update](https://core.telegram.org/bots/api#update) expecífico enviado pelo Telegram, por exemplo você pode executar uma função que responda a updates do tipo '_my_chat_member_' ou '_chat_member_'.

- Processando updates '_my_chat_member_'
```php
$tlg->on ('my_chat_member', function ($bot){
// code here
});
```
- Processando updates '_chat_member_'
```php
$tlg->on ('chat_member', 'TelegramBot:myChatMember');
```

### 🔥 [Envie os bots feitos com esse pacote](https://t.me/httd1), ele pode ser listado aqui!
• J.M
- [@scdownbot](https://t.me/scdownbot) (+18K Usuários)
Expand Down
7 changes: 7 additions & 0 deletions examples/MarkdownBot/bot.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
}
}');

// get and process reactions
$tlg->on ('message_reaction', function ($bot){

print_r ($bot->getContent ());

});

$tlg->command ('/start', 'MarkdownBot:start');
$tlg->command ('/help', 'MarkdownBot:help');
$tlg->commandMatch ('/^(?<texto>[^\/]+)/', 'MarkdownBot:markdownText');
Expand Down
Loading

0 comments on commit 6a25373

Please sign in to comment.