Skip to content

Bots 2.0 #151

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

Merged
merged 12 commits into from
Apr 19, 2016
Merged

Bots 2.0 #151

merged 12 commits into from
Apr 19, 2016

Conversation

jacklul
Copy link
Collaborator

@jacklul jacklul commented Apr 16, 2016

Bot API 2.0 - implemented changes

Added:

  • InlineKeyboardMarkup
  • InlineKeyboardButton (untested, needs to be placed in InlineKeyboardMarkup)
  • CallbackQuery
  • answerCallbackQuery
  • editMessageText
  • editMessageCaption
  • editMessageReplyMarkup (untested)
  • KeyboardButton (untested, needs to be placed in ReplyKeyboardMarkup)
  • InlineQueryResultAudio (untested)
  • InlineQueryResultDocument (untested)
  • InlineQueryResultLocation (untested)
  • InlineQueryResultVenue (untested)
  • InlineQueryResultVoice (untested)
  • InputMessageContent (untested)
  • InputTextMessageContent (untested)
  • InputLocationMessageContent (untested)
  • InputVenueMessageContent (untested)
  • InputContactMessageContent (untested)
  • kickChatMember (tested on selfkick - bot leaving a group, API responds http code error but bot leaves the group successfully)
  • unbanChatMember (untested)
  • MessageEntity
  • Venue
  • examples/Commands/InlinekeyboardCommand.php

Updated:

  • database structure (structure.sql) and DB.php
  • InlineQuery
  • InlineQueryResult (marking it untested because of InputMessageContent)
  • InlineQueryResultArticle
  • InlineQueryResultGif (untested)
  • InlineQueryResultMpeg4Gif (untested)
  • InlineQueryResultPhoto
  • InlineQueryResultVideo (untested)
  • ChosenInlineResult
  • Message
  • new_chat_participant and left_chat_participant renamed to new_chat_member and left_chat_member
  • examples/Commands/KeyboardCommand.php

Not Added/Updated:

  • InlineQueryResultCachedAudio
  • InlineQueryResultCachedDocument
  • InlineQueryResultCachedGif
  • InlineQueryResultCachedMpeg4Gif
  • InlineQueryResultCachedPhoto
  • InlineQueryResultCachedSticker
  • InlineQueryResultCachedVideo
  • InlineQueryResultCachedVoice
  • PHPUnit Tests

Changes that has to be made:

  • ReplyKeyboardMarkup needs to accept KeyboardButton object and place it in array
  • InlineKeyboardMarkup needs to accept InlineKeyboardButton object and place it in array

Miscellaneous:

  • updated copyright header in most files
  • all inline keyboards / new normal keyboards were tested and work correctly

Potential issues:

  • callback_query_id and inline_query_id are documented as string but bigint is used in the database instead, might need to be refactored into something like chosen_inline_query table?
  • objects check fields as empty(), some fields can have value '0' and will be considered empty incorrectly (look into MessageEntity for example)

Entries without '(untested)' indicate things that were tested and work wihout errors or exceptions and return expected result.

@MBoretto
Copy link
Collaborator

It's enough say thanks?
I've just a request. The function new chat participant has been moved to member.
I would like to have the possibility to store the chat participant field as new chat member.
I give to you an example:
I have old logs of a bot with field new chat participant. I would be able to process those old data with Telegram->processUpdate() and insert them on the member column.
For what concern Potential issue and changes to be made we can open some pull request to discuss them separately. Looking forward to merge!

@jacklul
Copy link
Collaborator Author

jacklul commented Apr 19, 2016

Restored them, this should do what you want (latest commit)?

…lity purposes, new_chat_participant and left_chat_participant = new_chat_member and left_chat_member
@MBoretto MBoretto merged commit da1f79d into php-telegram-bot:develop Apr 19, 2016
@jacklul jacklul deleted the bots-2-0 branch April 22, 2016 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants