Skip to content

danog\MadelineProto\EventHandler\Message\Rich\Text\Date: A date, shown in the local time zone of the user, in the specified format.

Back to index

Author: Daniil Gentili daniil@daniil.it

A date, shown in the local time zone of the user, in the specified format.

Properties

  • $text: danog\MadelineProto\EventHandler\Message\Rich\RichText Text shown by clients that don’t support dates
  • $date: int Unix timestamp of the date
  • $relative: bool Whether to show the date relative to the current time (e.g. “in 5 minutes”), ignoring the other flags
  • $shortTime: bool Whether to show the time in short format (e.g. 22:45)
  • $longTime: bool Whether to show the time in long format (e.g. 22:45:00)
  • $shortDate: bool Whether to show the date in short format (e.g. 17.03.22)
  • $longDate: bool Whether to show the date in long format (e.g. March 17, 2022)
  • $dayOfWeek: bool Whether to show the day of the week

Method list:

Methods:

__construct(\danog\MadelineProto\EventHandler\Message\Rich\RichText|string $text, int $date, bool $relative = false, bool $shortTime = false, bool $longTime = false, bool $shortDate = false, bool $longDate = false, bool $dayOfWeek = false)

Parameters:

  • $text: \danog\MadelineProto\EventHandler\Message\Rich\RichText|string
  • $date: int
  • $relative: bool
  • $shortTime: bool
  • $longTime: bool
  • $shortDate: bool
  • $longDate: bool
  • $dayOfWeek: bool

See also:

  • [\danog\MadelineProto\EventHandler\Message\Rich\RichText: Styled text of a rich message: a tree of plain texts, styles, links and so on.](../../../../../../danog/MadelineProto/EventHandler/Message/Rich/RichText.html)

from(\danog\MadelineProto\EventHandler\Message\Rich\RichText|string $text): \danog\MadelineProto\EventHandler\Message\Rich\RichText

Get a rich text from a rich text or a plain string.

Parameters:

  • $text: \danog\MadelineProto\EventHandler\Message\Rich\RichText|string

getText(): string

Get the plain text version of the rich text.

getEntities(): list<\danog\MadelineProto\EventHandler\Message\Entities\MessageEntity>

Get the entities for the styles of the plain text version of the rich text.

See also:

getHTML(bool $allowTelegramTags = false): string

Get an HTML version of the rich text.

Parameters:

  • $allowTelegramTags: bool Whether to allow telegram-specific tags like tg-spoiler, tg-emoji, mention links and so on…

Generated by danog/phpdoc