Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Support for Matrix notifications #503

Open
samip5 opened this issue Jul 25, 2021 · 7 comments
Open

[FR] Support for Matrix notifications #503

samip5 opened this issue Jul 25, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@samip5
Copy link

samip5 commented Jul 25, 2021

Is your feature request related to a problem? Please describe.
I'm always annoyed when I want to use Matrix for notifications but it's not supported.

Describe the solution you'd like
I would like to see support for Matrix

Describe alternatives you've considered
N/A

@samip5 samip5 added the enhancement New feature or request label Jul 25, 2021
@samip5 samip5 changed the title Support for Matrix notifications [FR] Support for Matrix notifications Jul 25, 2021
@bygui86
Copy link

bygui86 commented May 16, 2022

@samip5 sorry what do you mean with Matrix for notifications?

@samip5
Copy link
Author

samip5 commented May 17, 2022

@samip5 sorry what do you mean with Matrix for notifications?

@bygui86 I'm referring to this: https://matrix.org/docs/guides/client-server-api

@bygui86
Copy link

bygui86 commented May 17, 2022

@samip5 thanks for the reference, but still I don't really understand how you would like to implement the "Matrix" into the BotKube notifications :(

@samip5
Copy link
Author

samip5 commented May 17, 2022

@samip5 thanks for the reference, but still I don't really understand how you would like to implement the "Matrix" into the BotKube notifications :(

I want notifications though Matrix, which is basically just a POST request to a home server URL, and the reference has the format for it. Similar to how I can get Discrod notifications from Botkube.

Example way to send message in python:

async def send_matrix_notify(room, hs, content, token):
    global logger
    url = f"https://{hs}/_matrix/client/r0/rooms/{room}/send/m.room.message?access_token={token}"
    msg = {
        "body": content,
        "html": content,
        "msgtype": "m.text"
    }
    try:
        async with aiohttp.ClientSession() as session:
            async with session.post(url, json=msg) as resp:
                response = await resp.text()
                logger.info(f"Reponse from Matrix: {response}")
    except Exception as e:
        logger.error(f"Execption occured: {e}")

Could you try to explain what portion do you not understand?

@disconn3ct
Copy link
Contributor

As a more general option, perhaps the webhook could be customizable and/or templatable? That would allow it to work with a wide variety of services with minimal effort. A wiki page can hold examples for specific services such as Matrix.

@samip5
Copy link
Author

samip5 commented Jun 1, 2022

As long as the whole body of the request can be templated.

@HaveFun83
Copy link

matrix as supported provider will be really great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants