version: 2.1.3







__construct

called when create an object from class , handle settings and things
Must be out of handler class

Parameters

token String Token of your bot Yes
logger Boolean Write any of bpt and user action in log file Optional(true)
log_size Integer You can specify max log file size with this parameter , only work when logger is true , size setted by MB Optional(10)
security Boolean Change few things to increase your source security Optional(false)
secure_folder Boolean Change few things to increase your source folder security Optional(false)
multi Boolean ONLY WORK ON SOME WEBSERVERS!
receive updates and answer to them really fast, then start processing them
Optional(false)
split_update Boolean Make updates split to message , callback , inline and ... Optional(true)
array_update Boolean Change type of updates sended to your handler Optional(false)
db db change your bot database setting Optional(db)
auto_update Boolean Disable or enable BPT updater Optional(true)
max_connection Integer Maximum allowed number of simultaneous connections to the webhook , Higher is faster and need more resources.MAX 100 FOR TELEGRAM API Optional(40)
certificate InputFile Your certificate file , You can set it for using HTTP url in webhook Optional(null)
base_url String Your base api url , Change it if you use another base server Optional(https://api.telegram.org/bot)
down_url String Your down api url , Change it if you use another base server Optional(https://api.telegram.org/file/bot)
forgot_time Integer For telegram methods, Will be used in forgotten calls, connection will close after setted time in milisecond Optional(100)
receive String Specify receiver type, webhook for Webhook connection, getupdates for long polling and anything else for disable receiver Optional(webhook)
handler Boolean Disable the handler style,IN getupdates RECEIVER YOU MUST TURN ON HANDLER Optional(true)
allowed_updates Array of String Specify your wanted update types in array of string, See all of update types here Optional(['message', 'edited_channel_post', 'callback_query', 'inline_query'])
debug Boolean Check more things in your code and write more logs. TURN IT OFF IN YOUR RELEASE VERSION Optional(false)

Method errors

ErrorNamedescription
token missing set your token when call the class
token is not true your token format is not true
getUpdates not allowed you can't use getUpdates receiver when handler is off
wrong db type wrong db type , it must be json or sql in lowercase
sql connection problem there is sql connection error(s) , check log
sql name parameter sql name parameter not found
sql pass parameter sql pass parameter not found
sql user parameter sql user parameter not found

Method examples

$BPT = new BPT(['token'=>String]);

Method alices

There is no alices

Method output :

BPT