Skip to main content

AoiTelegram@0.7.0

Added

  • Added the method <AoiClient>.hasFunction, which allows checking if a function exists in the library.
  • Added the method <AoiClient>.ensureFunction, which allows manually overwriting or modifying functions.
  • Introduced a new way of creating functions called callback. These functions have a different syntax compared to custom functions. Callback functions do not overwrite core functions and have a set of functions for interaction.

Changed

  • Most variables in the classes provided by aoitelegram are no longer private from the perspective of typescript (Command, Action, Awaited, Timeout).
  • Changed the type unknown to a generic type in the method <CustomEvent>.emit.
  • Now action and command can be tracked by multiple handlers, not just one.
  • Attempting to set a new handler for timeout/loop commands will now result in an error.
  • The method <AoiClient>.addFunction no longer allows overwriting functions as it did before. Also, <AoiClient>.editFunction cannot add a function. These functions now adhere to their original purpose.
  • Renamed <AoiClient>.command to <AoiClient>.addCommand, and <AoiClient>.action to <AoiClient>.addAction.
  • The library will no longer assign functions to global classes (e.g., String and methods like replaceLast and after).
  • To reduce file size, the library will use UglifyJS only for internal folders where functions are stored.
  • Completely revised comments in the source code to adhere to typedoc, instead of the previous mixture of typedoc and jsdoc.

Fixed

AoiTelegram Functions

Changed

  • The function $ping now accepts the parameter type (client - bot ping, db - database ping).

Fixed

  • The function $jsEval.

Added

  • Added a new operator ! to prevent all errors in undefined (syntax: $!functionName).
  • Added functions $continue and $index for loop/awaited commands.
  • The function $argumentsCount is now available for custom functions with the aoitelegram syntax.
  • Added functions: $stopTimeout, $hasTables, $tablesCount, $variablesCount, $packageDependencies, $charCount, $cropText, $reverse, $toLocaleUpperCase, $bufferAlloc, $bufferCreate, $bufferLength, $bufferToString, $matchRegex, $testRegex, $abs, $ceil, $advancedTextSplit, $callback, $error, $parseTime, $readyTimestamp, $uri, $maxRam, $and, $findSpecialChars, $or, $index, $continue, $executionTime, $argumentsCount, $arguments, $maxSafeInteger, $isNegative, $isPositive, $callFunction, $randomUUID, $bufferAllocUnsafe.