You question is more related to script. It is out of our scope. I will remove office-teams-linux-itpro tag. Thanks for your understanding.
Meanwhile, there is an alternative solution. You can create a chat by pre-populating the deep links with required parameters. A deep link launches the browser first before navigating to content and information.
The following is an example:
https://teams.microsoft.com/l/chat/0/0?users=user01@Company portal .com&message=Hi%20folks%2C%20kicking%20off%20a%20chat%20about%20our%20meeting%20tomorrow
For more details about deep links, please refer to this article.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.