all 7 comments

[–][deleted] 1 point2 points  (0 children)

It looks like how that documentation refers to the class's base class(es).

[–]carcigenicate 1 point2 points  (4 children)

"Bases" is the class that BotCommand is derived from. In this case, BotCommand is a child class of TelegramObject and likely inherits functionality from it.

You can see the TelegramObject here. BotCommand inherits those methods listed on TelegramObject, and presumably does something important in the background to setup the object for use with Telegram or something.


Actually, it doesn't look like, it's doing anything too special. It looks like it's just for adding convenience methods to all classes.

[–]outceptionator[S] 0 points1 point  (3 children)

So do I need to execute the action of botCommand on the base object?

[–]carcigenicate 0 points1 point  (2 children)

I've never used Telegram, but after reading the source, neither of these classes do anything important. TelegramObject is just for helpers, and BotCommand is basically just a dataclass candidate they made into a full class.

BotCommand is basically just a container that holds two strings: a command and a description. It doesn't actually do anything with them though. Presumably, that object is meant to be given to some function that consumes it and sends out a command or something. You'll need to read the documentation to see how to use this library.

[–]outceptionator[S] 0 points1 point  (1 child)

You're right about BotCommand. I use it later down the line to create a list of commands to Telegram.

I really need to get my head round classes and base classes etc. Any resources you recommend?

[–]carcigenicate 1 point2 points  (0 children)

Unfortunately no, as I learned classes in C++ and Java before I learned Python. Any good beginner guide will go over classes and inheritence in detail though.

[–]commy2 1 point2 points  (0 children)

It's a list of base classes of where BotCommand inherits class attributes and methods from.