-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Message Thread ID (Topics) #5
Conversation
Looks good but please fix the error code sniffer is whining about |
Also, it looks like a mistake in it says: @param Level $level The minimum logging level at which this handler will be triggered but actually it can handle not just This can be a problem with PHPStan or any other static code analyzer, which prioritizes, in most cases, document block parameter definitions over actual type hints. Looks like it should be improved to: @param int|string|Level $level The minimum logging level at which this handler will be triggered If it should be fixed, then it should be done as a separate pull request or we can fix it here? If you agree that this should be fixed, what a proper formatting (alignment) should be in that case? Variant №1: /**
* @param string $token Telegram bot API token
* @param int $chatId Chat ID to which logs will be sent
* @param int|string|Level $level The minimum logging level at which this handler will be triggered
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param bool $useCurl Whether to use cURL extension when available or not
* @param int $timeout Maximum time to wait for requests to finish
* @param bool $verifyPeer Whether to use SSL certificate verification or not
* @param int|null $messageThreadId Thread ID for group chats with Topics feature enabled
*/ Variant №2: /**
* @param string $token Telegram bot API token
* @param int $chatId Chat ID to which logs will be sent
* @param int|string|Level $level The minimum logging level at which this handler will be triggered
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param bool $useCurl Whether to use cURL extension when available or not
* @param int $timeout Maximum time to wait for requests to finish
* @param bool $verifyPeer Whether to use SSL certificate verification or not
* @param int|null $messageThreadId Thread ID for group chats with Topics feature enabled
*/ Both variants passes |
I don't mind fixing it in this PR, the second variant is more readable |
Synced with the master and added a second variant of the docblock to |
Thanks! |
This PR adds optional support for sending messages to specific group threads. This is a feature of group chats with the Topics feature enabled.
https://core.telegram.org/bots/api#sendmessage
For backward compatibility, it is added as a last parameter.