Skip to content
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

Backport some v4 features #965

Merged
merged 6 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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