Here's a basic documentation page that explains how to use the library:
The Utils library is a powerful tool designed to simplify complex JavaScript operations and provide a range of functionalities for your Bots.Business application. This documentation will guide you through the process of using the library's features to enhance your bot's capabilities.
- Make sure you have a Bots.Business account set up.
- Import the
Utilslibrary into your bot's libs.
Ban a user from your bot.
tgUserId: Telegram User ID to be banned.- Calling Method:
Lib.Utils.banUser(tgUserId)
Unban a user previously banned by the bot.
tgUserId: Telegram User ID to be unbanned.- Calling Method:
Lib.Utils.unbanUser(tgUserId)
Inspect users to manage access and permissions.
- Calling Method:
Lib.Utils.inspectUser()
Create a custom command with associated JavaScript code.
commandName: Name of the custom command.jsCode: JavaScript code to be associated with the custom command.- Calling Method:
Lib.Utils.createCustomCommand(commandName, jsCode)
... There are many more functions!
- Import the library using
Lib.Utils. - Call the desired method by chaining it to the library name and method name. For example, to ban a user, use
Lib.Utils.banUser(tgUserId). - Provide the necessary parameters to the method as described in the function overview.
Lib.Utils.banUser(123456789);var customJsCode = "Bot.sendMessage('This is a custom command!')";
Lib.Utils.createCustomCommand("custom", customJsCode);Found a bug or have an idea for improvement? Feel free to open an issue or submit a pull request on the GitHub repository.