This repository was archived by the owner on Sep 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 176
Upgrading from v1 to v2
Camilo Sperberg edited this page Nov 17, 2016
·
1 revision
If you used v1.x of this package before, be aware of the v2 changes! There are changes in this package (so named "internal changes") as well as in the Telegram API as well (called "External changes").
The most important change is that the package has a different namespace now! It used to be:
unreal4u\
Now it is:
unreal4u\TelegramAPI\
The other big change is that InlineQueryResult* classes now have their own namespace. So, what used to be:
$inlineQueryResultArticle = new unreal4u\Telegram\Types\InlineQueryResultArticle();Is now:
$inlineQueryResultArticle = new unreal4u\TelegramAPI\Telegram\Types\Inline\Query\Result\Article();Please note the extra backslash between Inline, query, result and Article.
The same is true for the other 18 new Inline\Query\Results.
Other changes include ChosenInlineResult (now Inline\ChosenResult) and InlineQuery (now Inline\Query).
Telegram objects are a bit different. Some backwards incompatible changes are:
- The
ReplyKeyboardMarkupobject no longer is an array of strings, but an array ofKeyboardButton - The
AnswerInlineQueryobject now includes a newreply_markupand ainput_message_contentfield, which is an optional inline keyboard attached to the message - The
InlineQueryResultobjects had a major revamp, so many options were replaced with others. Please consult the documentation regarding these objects