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:
3333``` java
3434public 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```
You can’t perform that action at this time.
0 commit comments