Initial commit

This commit is contained in:
Chris Plaatjes 2023-02-22 15:34:50 -05:00
commit 45cd7a1270
6 changed files with 1791 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
go.old
node_modules

0
README.md Normal file
View File

7
config/bot.json Normal file
View File

@ -0,0 +1,7 @@
{
"syncToken": null,
"filter": null,
"appserviceUsers": {},
"appserviceTransactions": {},
"kvStore": {}
}

26
index.js Normal file
View File

@ -0,0 +1,26 @@
const sdk = require("matrix-bot-sdk");
const MatrixClient = sdk.MatrixClient;
const SimpleFsStorageProvider = sdk.SimpleFsStorageProvider;
const AutojoinRoomsMixin = sdk.AutojoinRoomsMixin;
const homeserverUrl = "";
const accessToken = "";
const storage = new SimpleFsStorageProvider("config/bot.json");
const client = new MatrixClient(homeserverUrl, accessToken, storage);
AutojoinRoomsMixin.setupOnClient(client);
client.start().then(() => console.log("Client started!"));
client.on("room.message", (roomId, event) => {
if (! event["content"]) return;
const sender = event["sender"];
const body = event["content"]["body"];
console.log(`${roomId}: ${sender} says '${body}`);
});
client.sendMessage(roomId, {
"msgtype": "m.text",
"body": "This is message text.",
});

1733
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

23
package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "matrixtiktok",
"version": "1.0.0",
"description": "A bot to convert TikTok URLs into plain video format",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://git.kizaing.ca/kizaing/MatrixTikTok"
},
"keywords": [
"matrix",
"tiktok"
],
"author": "Kizaing",
"license": "GPL-3.0",
"dependencies": {
"matrix-bot-sdk": "^0.6.3",
"typescript": "^4.9.5"
}
}