https://github.com/Cosium/matrix-communication-client
A java client for the Matrix protocol.
https://github.com/Cosium/matrix-communication-client
matrix
Last synced: 4 months ago
JSON representation
A java client for the Matrix protocol.
- Host: GitHub
- URL: https://github.com/Cosium/matrix-communication-client
- Owner: Cosium
- License: mit
- Created: 2023-06-28T21:09:24.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-12-02T17:01:19.000Z (5 months ago)
- Last Synced: 2024-12-20T06:13:48.208Z (4 months ago)
- Topics: matrix
- Language: Java
- Homepage: https://matrix.org/
- Size: 82 KB
- Stars: 27
- Watchers: 4
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-matrix-bots - Matrix Communication Client (Cosium)
README
[](https://github.com/Cosium/matrix-communication-client/actions/workflows/ci.yml)
[](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.cosium.matrix_communication_client%22%20AND%20a%3A%22matrix-communication-client%22)# Matrix Communication Client
A [Matrix](https://matrix.org/) java client.
# Example
```java
public class Example {public static void main(String[] args) {
MatrixResources matrix =
MatrixResources.factory()
.builder()
.https()
.hostname("matrix.example.org")
.defaultPort()
.usernamePassword("jdoe", "secret")
.build();RoomResource room = matrix
.rooms()
.create(
CreateRoomInput.builder()
.name("Science")
.roomAliasName("science")
.topic("Anything about science")
.build());
room.sendMessage(Message.builder().body("Hello !").formattedBody("Hello !").build());
}
}
```Another example with existing room:
```java
public class Example {public static void main(String[] args) {
MatrixResources matrix =
MatrixResources.factory()
.builder()
.https()
.hostname("matrix.example.org")
.defaultPort()
.usernamePassword("jdoe", "secret")
.build();RoomResource room = matrix
.rooms()
.byId("!PVvauSmjcHLwoAJkyT:matrix.example.org");
room.sendMessage(Message.builder().body("Hello !").formattedBody("Hello !").build());
}
}
```# Dependency
```xml
com.cosium.matrix_communication_client
matrix-communication-client
${matrix-communication-client.version}```