Compare commits
4 commits
3e9d97dedd
...
d6c3b25cc4
Author | SHA1 | Date | |
---|---|---|---|
d6c3b25cc4 | |||
a7a32a23c5 | |||
13cb7a463e | |||
88033b3474 |
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -152,6 +152,8 @@ cython_debug/
|
|||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
|
||||
#############################################################################################
|
||||
|
||||
# ignore folders
|
||||
node_modules
|
||||
|
||||
|
|
16
README.md
16
README.md
|
@ -1,3 +1,17 @@
|
|||
# text-gen-bot
|
||||
|
||||
Matrix bot that generates messages based off of messages of other users using a neural network.
|
||||
Matrix bot that generates messages based off of messages of other users using a neural network.
|
||||
|
||||
## Development setup
|
||||
|
||||
Install JavaSript SDK:
|
||||
|
||||
```sh
|
||||
pnpm add matrix-bot-sdk
|
||||
```
|
||||
|
||||
Install Python module:
|
||||
|
||||
```sh
|
||||
pip3 install textgenrnn
|
||||
```
|
||||
|
|
13
index.js
13
index.js
|
@ -0,0 +1,13 @@
|
|||
import config from './config.json' assert {type: "json"};
|
||||
import { MatrixClient, SimpleFsStorageProvider, AutojoinRoomsMixin } from "matrix-bot-sdk";
|
||||
|
||||
const storage = new SimpleFsStorageProvider("storage.json");
|
||||
const client = new MatrixClient(config.baseUrl, config.token, storage);
|
||||
|
||||
AutojoinRoomsMixin.setupOnClient(client)
|
||||
client.start().then(() => console.log(`Client has started!`));
|
||||
|
||||
client.on("room.message", (roomId, event) => {
|
||||
if (! event["content"] || event["sender"] === config.userId) return;
|
||||
// code here
|
||||
})
|
6
package.json
Normal file
6
package.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"matrix-bot-sdk": "^0.6.1"
|
||||
},
|
||||
"type": "module"
|
||||
}
|
1124
pnpm-lock.yaml
Normal file
1124
pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue