Skip to content

Commit 55ccf69

Browse files
committed
Update README for updated MatrixClient creation
1 parent 4009a09 commit 55ccf69

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,27 @@ then you can add `java-matrix-bot-lib` as a dependency:
3333
```java
3434
public class MyMatrixBot implements MatrixEventConsumer {
3535

36-
private MatrixClient matrixClient;
36+
private MatrixClient matrixClient;
3737

38-
public MyMatrixBot() {
38+
public MyMatrixBot() {
3939

40-
MatrixClient matrixClient = new MatrixClient("https://matrix.example.com", "username", "password");
41-
matrixClient.setPersistedState(matrixStatePersistence);
42-
}
40+
MatrixClient matrixClient = MatrixClient.create("https://matrix.example.com", "username", "password");
41+
matrixClient.setPersistedState(matrixStatePersistence);
42+
}
4343

44-
public void startBot() {
45-
// Blocks the thread
46-
matrixClient.syncContinuous();
47-
}
44+
public void startBot() {
45+
// Blocks the thread
46+
matrixClient.syncContinuous();
47+
}
4848

49-
public void stopBot() {
49+
public void stopBot() {
5050

51-
matrixClient.requestStopOfSync();
52-
}
51+
matrixClient.requestStopOfSync();
52+
}
5353

54-
@Override
55-
public void onMessage(MatrixState state, MatrixRoom room, MatrixMessage message) {
56-
// ...
57-
}
54+
@Override
55+
public void onMessage(MatrixState state, MatrixRoom room, MatrixMessage message) {
56+
// ...
57+
}
5858
}
5959
```

0 commit comments

Comments
 (0)