Webhook bot python don't does not respond to button presses

Hi. I’m trying to write a python bot that will send a message with buttons. When you click on a nickname, a website opens or some action is performed.

I use mmpy_bot. The message is created and when you press the button nothing happens.

I do it by example - mmpy_bot/webhook_example.py at main · attzonko/mmpy_bot · GitHub

n the settings, enabled
WEBHOOK_HOST_ENABLED = True,
WEBHOOK_HOST_URL = “10.8.8.8”,
WEBHOOK_HOST_PORT = 8579,

please help me figure out how to make the buttons correctly so that they send to another site or create a message or overwrite

Hi @KakEgorka ,

this is most likely related to the setting “Enable Insecure Outgoing Connections” being set to false in System console → Environment → Web Server. The default scheme for WEBHOOK_HOST_URL most likely is http since you omitted it, so if your backend application can be made available via https, please use https://10.8.8.8 as value for WEBHOOK_HOST_URL and if this is not possible, you need to enable insecure outgoing connections in your system settings.

Hi, we have the value set to true in “Enable Insecure Outgoing Connections”. But it didn’t fix the situation :pensive:
And you can somehow check whether the WEBHOOK requests go to https://10.8.8.8 ?

You can check the access logs on the receiving side to see if the request is landing there. If not, you will have to check on the sending site if there are maybe issues with routing or firewalling that would prevent access.
What does your Mattermost deployment look like? Binary installation? Docker?

we have - Binary installation

OK, does curl https://10.8.8.8:8579 or curl http://10.8.8.8:8579 work directly on the console of your Mattermost server or are you getting any errors when running these commands?

I get a 404: Not Found error even on the terminal where python is running when I run curl http://10.8.54.2:8579

Do I understand correctly that mmpy_bot creates its own WEBHOOK server and Mattermost sends requests to it?

Found the problem. There were network restrictions
Thank you

Hi again and sorry for the late reply!

Wondering what network restrictions that have been that would result in a 404 (Not found) on the client side, so if you like to share, go ahead, otherwise glad to hear it’s working for you now.

I am not entirely competent in this matter. But business was in different networks.

Can you please tell me how to make it so that when you click on the button, the site opens?

The buttons usually only communicate with the integrations, so when you display a button in a post and the user clicks on it, a predefined payload is being sent to your integration telling it that your user clicked on button xyz, there won’t be a window opening on the computer of the user. Did I maybe misunderstand you? Can you describe what kind of integration you’d like to create?

I want to make when the user clicks the buttons, another site opens for him.