diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..31c7b0d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +# Prevent these directories from being exported in the distribution archive +/docs export-ignore +/tests export-ignore +/.github export-ignore +/phpunit.xml export-ignore +/.gitignore export-ignore +/.gitattributes export-ignore \ No newline at end of file diff --git a/docs/format.md b/docs/format.md index 5757ae9..9cd402f 100644 --- a/docs/format.md +++ b/docs/format.md @@ -94,6 +94,22 @@ $this->reply(FormatHelper::codeBlock('block code', 'php')); // Output:
block code
``` +### time(int $unix, string $format = ''): string + +Formats a Unix timestamp for display. Supports multiple format options: + +- `w`: Day of the week in the user's language +- `d`: Short date format (e.g., "17.03.22") +- `D`: Long date format (e.g., "17 de marzo de 2022") +- `t`: Short time format (e.g., "22:45") +- `T`: Long time format (e.g., "22:45:00") +- `r`: Relative time from current moment + +```php +$this->reply(FormatHelper::time(1710691200, 't')); +// Output: fecha +``` + ### blockQuote(string $text): string Formats the provided text as a blockquote. @@ -109,14 +125,5 @@ Formats the provided text as an expandable blockquote. ```php $this->reply(FormatHelper::expandableBlockQuote('This is an expandable blockquote')); -// Output: This is an expandable blockquote -``` - -### sanatize(string $text): string - -Sanitizes the provided text, escaping HTML special characters. - -```php -$this->reply(FormatHelper::sanatize('')); -// Output: <script>alert("Hello")</script> +// Output:
This is an expandable blockquote
``` \ No newline at end of file diff --git a/src/Bot.php b/src/Bot.php index 9c6f659..8363b70 100644 --- a/src/Bot.php +++ b/src/Bot.php @@ -17,7 +17,7 @@ class Bot { public const NAME = 'xBot'; - public const VERSION = '4.2.0'; + public const VERSION = '4.2.1'; public ?Update $update = null;