Skip to content

Commit

Permalink
Backport some v4 features (#965)
Browse files Browse the repository at this point in the history
  • Loading branch information
lptn authored Jul 7, 2022
1 parent 0181e8e commit 50b05f7
Show file tree
Hide file tree
Showing 108 changed files with 1,788 additions and 1,412 deletions.
39 changes: 27 additions & 12 deletions src/Actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,47 @@
class Actions
{
/** Sets chat status as Typing. */
const TYPING = 'typing';
public const TYPING = 'typing';

/** Sets chat status as Sending Photo. */
const UPLOAD_PHOTO = 'upload_photo';
public const UPLOAD_PHOTO = 'upload_photo';

/** Sets chat status as Recording Video. */
const RECORD_VIDEO = 'record_video';
public const RECORD_VIDEO = 'record_video';

/** Sets chat status as Sending Video. */
const UPLOAD_VIDEO = 'upload_video';
public const UPLOAD_VIDEO = 'upload_video';

/** Sets chat status as Recording Audio. */
const RECORD_AUDIO = 'record_audio';
/**
* @deprecated Please use RECORD_VOICE (the correct one)
* Sets chat status as Recording Audio.
*/
public const RECORD_AUDIO = 'record_voice';

/** Sets chat status as Sending Audio. */
const UPLOAD_AUDIO = 'upload_audio';
/** Sets chat status as Recording Voice. */
public const RECORD_VOICE = 'record_voice';

/**
* @deprecated Please use UPLOAD_VOICE (the correct one)
* Sets chat status as Sending Audio.
*/
public const UPLOAD_AUDIO = 'upload_voice';

/** Sets chat status as Sending Voice. */
public const UPLOAD_VOICE = 'upload_voice';

/** Sets chat status as Sending Document. */
const UPLOAD_DOCUMENT = 'upload_document';
public const UPLOAD_DOCUMENT = 'upload_document';

/** Sets chat status as Choosing Sticker. */
public const CHOOSE_STICKER = 'choose_sticker';

/** Sets chat status as Choosing Geo. */
const FIND_LOCATION = 'find_location';
public const FIND_LOCATION = 'find_location';

/** Sets chat status as Recording Video Note. */
const RECORD_VIDEO_NOTE = 'record_video_note';
public const RECORD_VIDEO_NOTE = 'record_video_note';

/** Sets chat status as Sending Video Note. */
const UPLOAD_VIDEO_NOTE = 'upload_video_note';
public const UPLOAD_VIDEO_NOTE = 'upload_video_note';
}
1 change: 1 addition & 0 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public function __construct($token = null, $async = false, $httpClientHandler =
}

/**
* @deprecated This method will be removed in SDK v4.
* Invoke Bots Manager.
*
* @param $config
Expand Down
57 changes: 57 additions & 0 deletions src/EntityType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

namespace Telegram\Bot;

/**
* Class EntityType.
*/
final class EntityType
{
/** Sets MessageEntity Type as mention. */
public const MENTION = 'mention';

/** Sets MessageEntity Type as hashtag . */
public const HASHTAG = 'hashtag';

/** Sets MessageEntity Type as cashtag. */
public const CASHTAG = 'cashtag';

/** Sets MessageEntity Type as Bot Command. */
public const BOT_COMMAND = 'bot_command';

/** Sets MessageEntity Type as url. */
public const URL = 'url';

/** Sets MessageEntity Type as email. */
public const EMAIL = 'email';

/** Sets MessageEntity Type as phone number. */
public const PHONE_NUMBER = 'phone_number';

/** Sets MessageEntity Type as bold. */
public const BOLD = 'bold';

/** Sets MessageEntity Type as italic. */
public const ITALIC = 'italic';

/** Sets MessageEntity Type as underline. */
public const UNDERLINE = 'underline';

/** Sets MessageEntity Type as strike through. */
public const STRIKETHROUGH = 'strikethrough';

/** Sets MessageEntity Type as spoiler . */
public const SPOILER = 'spoiler';

/** Sets MessageEntity Type as code. */
public const CODE = 'code';

/** Sets MessageEntity Type as pre. */
public const PRE = 'code';

/** Sets MessageEntity Type as text link. */
public const TEXT_LINK = 'text_link';

/** Sets MessageEntity Type as text mention. */
public const TEXT_MENTION = 'text_mention';
}
Loading

0 comments on commit 50b05f7

Please sign in to comment.