Bots.Business - Help
  • Welcome
  • Getting started
  • Create bot from Google Table
  • App
    • Reset or Update Your Password
  • Commands
    • Answer
    • Aliases
    • Keyboard
    • Groups
    • Wait for answer
    • Auto Retry (AR)
  • Coding: BJS
    • Variables
    • Bot functions
    • Message broadcasting and editing
    • User functions
    • Properties
    • Always running commands
    • Error command: "!"
    • Lists
      • Migration from properties to list
    • Api functions
    • BB Admin functions
    • Admin Panel
    • Send HTTP request
    • Web App
    • Caching
    • Inline Bot
    • BJS Security
    • Good coding practices
    • Top errors
  • Git
    • Import bot from Git repository
    • Export bot to Git repository
    • Repository structure
    • File: bot.json
    • Automatic importing on Git push
  • Iterations. How to reduce theys?
  • Limitations
  • Cloud
  • Reports
  • Deep Linking - pass any params on Bot starting
  • How to link chat account with BB account?
  • BB Inspection
  • Protected bot
  • VS Code
  • How to...
  • Smart Bot
    • Overview
    • Lang File
    • SmartBot
    • SmartTasker
    • Amount Dialog
  • Libs
    • What it is - Libs?
    • Libs development
    • RefferalLib
    • ResourcesLib
    • Random
    • MembershipChecker (MCL)
    • Cooldown Lib
    • CurrencyConverter
    • Lang
    • TopBoardLib
    • QiwiPayments
    • Coinbase (CB)
    • CoinPayments (CP)
    • OxaPay
    • CryptoJS
    • CurrencyQuote
    • GoogleApp
    • GoogleTableSync
    • Guard
    • Webhooks lib
    • DateTimeFormat Lib
  • Store
    • BB Point Bot
    • Welcome bot
    • Help bot
    • SRB Demo Keyboard Tools
Powered by GitBook
On this page
  • You can inspect any variable for debug

Was this helpful?

  1. Coding: BJS

Variables

In BJS we have useful global variables.

Variable

Description

request

it is collection with a lot of data. You can see it by:

message

current message from user - string

user

user who sent a command or text.

Fields: id (BB id),

telegramid (telegram id),

first_name,

last_name,

username,

created_at,

updated_at,

just_created (true for new user or false for already exist.

User must be totally new in BB! He is old if he start any BB bot before) Can be blank:

first_name, last_name, username

chat

data for current chat.

Fields:

id (BB id),

chatid (telegram chat id),

bot_id,

title,

chat_type (can be: "private", "group", "supergroup"),

user_id,

created_at,

updated_at,

just_created - true for new (just created) chat or false for already exist

Note:

BB delete blocked chats after 6 months. If user start blocked bot after 6 months this chat have just_created field again

bot

data for bot.

Fields:

id,

name,

token,

created_at,

updated_at,

csv_url,

last_run_at,

store_bot_id,

status

command

data for command.

Fields:

id,

name,

folder,

need_reply,

auto_retry_time, last_auto_retry_at, created_via_csv_import, last_csv_import_at,

created_at,

updated_at

params

command parameters - text

owner

information about bot owner: email, id and etc

completed_commands_count

iteration_quota

current quota information: limit, progress and etc. You can see it by Bot.sendMessage( inspect(iteration_quota) )

payment_plan

current bot owner payment plan information

BB_API_URL

api url: api.bots.business. Each Cloud have own Api Url

You can inspect any variable for debug

Bot.sendMessage( inspect(user) )
Bot.sendMessage( inspect(chat) )
PreviousCoding: BJSNextBot functions

Last updated 9 months ago

Was this helpful?

Bot.inspect(request) All fields available . All field will be in request. With request you can track all updates.

the count of previously completed commands on Bot.runCommand calls. Can be used for

security
here
Read more