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

Added underline, spoiler and strikethrough message types #3

Merged
Merged
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
24 changes: 24 additions & 0 deletions src/Api/Type/Message/MessageEntityType.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ final class MessageEntityType implements Enum

private const MENTION = 'mention';

private const UNDERLINE = 'underline';

private const SPOILER = 'spoiler';

private const STRIKETHROUGH = 'strikethrough';

private const LIST = [
self::HASH_TAG,
self::CASH_TAG,
Expand All @@ -59,6 +65,9 @@ final class MessageEntityType implements Enum
self::TEXT_LINK,
self::TEXT_MENTION,
self::MENTION,
self::UNDERLINE,
self::SPOILER,
self::STRIKETHROUGH,
];

/**
Expand Down Expand Up @@ -144,6 +153,21 @@ public static function mention(): self
return new self(self::MENTION);
}

public static function underline(): self
{
return new self(self::UNDERLINE);
}

public static function spoiler(): self
{
return new self(self::SPOILER);
}

public static function strikethrough(): self
{
return new self(self::STRIKETHROUGH);
}

public function equals(MessageEntityType $type): bool
{
return $this->value === $type->value;
Expand Down