Checking chatid when sending a command through a bot

Hey!

Guys, can u please tell me if it is possible to set a permission (i.e. check chatid) for working with a command sent through a bot?

For example, what I mean.

  1. There are several commands, for example command1 and command2
  2. there are three chatids in the HA configuration (three different users / family members)
  3. is it possible to check from which chatid the command was sent?
  4. And if the command2 sent with a chatid to whom we forbid to use this command - for this chatid it did not work?
  5. Those. Out of three users, only 2 could use commad2? …and command1 is available for all three users/chatid and etc.

Thanks.

Guys, any ideas?