unreal4u / telegram-api

Complete async capable Telegram bot API implementation for PHP7
https://github.com/unreal4u/telegram-api/wiki
MIT License
784 stars 172 forks source link

Add constants for available string values #107

Closed kavnik closed 4 years ago

kavnik commented 4 years ago

There are no enums in PHP, but it might be useful to add constants for available string values.

For example, in sendChatAction there is a parameter action with available values: typing, upload_photo , record_video etc.

For this values it's possible to add constants in SendChatAction class: const TYPE_TYPING = 'typing'; const TYPE_UPLOAD_PHOTO = 'upload_photo'; ...

IDE will allow you to avoid typos and will give a prompt with autocomplete.

unreal4u commented 4 years ago

Hi @kavnik : This is certainly possible and also a good idea 👍

You can shoot in a PR or wait until I got time to implement it (which will possibly be tonight)

unreal4u commented 4 years ago

Implemented in v3.6.0!