File tree Expand file tree Collapse file tree 1 file changed +16
-16
lines changed Expand file tree Collapse file tree 1 file changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -33,27 +33,27 @@ then you can add `java-matrix-bot-lib` as a dependency:
33
33
``` java
34
34
public class MyMatrixBot implements MatrixEventConsumer {
35
35
36
- private MatrixClient matrixClient;
36
+ private MatrixClient matrixClient;
37
37
38
- public MyMatrixBot () {
38
+ public MyMatrixBot () {
39
39
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
+ }
43
43
44
- public void startBot () {
45
- // Blocks the thread
46
- matrixClient. syncContinuous();
47
- }
44
+ public void startBot () {
45
+ // Blocks the thread
46
+ matrixClient. syncContinuous();
47
+ }
48
48
49
- public void stopBot () {
49
+ public void stopBot () {
50
50
51
- matrixClient. requestStopOfSync();
52
- }
51
+ matrixClient. requestStopOfSync();
52
+ }
53
53
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
+ }
58
58
}
59
59
```
You can’t perform that action at this time.
0 commit comments