Class: CbBot documentation

cbbot~CbBot()

new CbBot()

Source:

Members

bot

Bot startup with new Telegraf object

Source:

cmds

Commands array

Source:

creds

Import BOT_TOKEN from creds json file

Source:

digst

Import digest bot function (aka parse feeds )

Source:

mibank

Import mibank bot function (get bank account status)

Source:

rfrsh

Import refresh bot function (aka fetch and store feeds )

Source:

showf

Import showfiles bot function (aka tree DTAFOOD/ )

Source:

Telegraf

Import telegraf module for easy bot management

Source:

User

To get authentication and user datas methods

Source:

Methods

authme(cmd, user, ctx)

Authentification based on in chat Telegram user ID and local db records

Parameters:
Name Type Description
cmd string

The requested command [ /cmd + args ]

user Objet

An object containing first and last names and TelegramID

ctx Object

The telegraf object containing methods and user chat

Source:

getcommands()

Listen for '/[cmd]' style message to run bot functions for registered users

Source:

logthiscmd(cmd, usr)

Dummy logger helper function to print received cmd

Parameters:
Name Type Description
cmd string

new client assets data to be recorded

usr Object

user first_name , last_name and socket ID

Source:

logthismsg()

Logging helper function to print all messages sent to bot

Source:

runcommands(cmd, ctx, who)

Kind of switch statement for running known bot command's

Parameters:
Name Type Description
cmd string

The requested command [ /cmd + args ]

ctx Object

The telegraf object containing methods and user chat

who Object

The object containing all user data from db

Source:

turnmeon()

Main launcher method

Properties:
Name Type Description
bot.start function

answer Welcome when start

bot.hello function

if hello cmd answer with Welcome message

bot.hears function

other way to get a reply from bot

Source: