Compare commits
2 commits
2c3b653b54
...
7e9005216d
Author | SHA1 | Date | |
---|---|---|---|
7e9005216d | |||
87cad6c613 |
9 changed files with 2795 additions and 685 deletions
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -1,8 +1,8 @@
|
|||
const reg = require("../matrix/read-registration")
|
||||
const AppService = require("matrix-appservice").AppService
|
||||
const as = new AppService({
|
||||
homeserverToken: reg.hs_token
|
||||
})
|
||||
as.listen(+(new URL(reg.url).port))
|
||||
// @ts-check
|
||||
|
||||
module.exports = as
|
||||
const reg = require("../matrix/read-registration")
|
||||
const {AppService} = require("@cloudrac3r/in-your-element")
|
||||
const as = new AppService(reg)
|
||||
as.listen()
|
||||
|
||||
module.exports.as = as
|
||||
|
|
802
package-lock.json
generated
802
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -19,6 +19,7 @@
|
|||
"@cloudrac3r/discord-markdown": "^2.6.2",
|
||||
"@cloudrac3r/giframe": "^0.4.3",
|
||||
"@cloudrac3r/html-template-tag": "^5.0.1",
|
||||
"@cloudrac3r/in-your-element": "^1.0.0",
|
||||
"@cloudrac3r/mixin-deep": "^3.0.0",
|
||||
"@cloudrac3r/pngjs": "^7.0.3",
|
||||
"@cloudrac3r/turndown": "^7.1.4",
|
||||
|
@ -30,7 +31,6 @@
|
|||
"get-stream": "^6.0.1",
|
||||
"heatsync": "^2.5.3",
|
||||
"js-yaml": "^4.1.0",
|
||||
"matrix-appservice": "^2.0.0",
|
||||
"minimist": "^1.2.8",
|
||||
"node-fetch": "^2.6.7",
|
||||
"prettier-bytes": "^1.0.4",
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @property {import("./d2m/discord-client")} discord
|
||||
* @property {import("heatsync").default} sync
|
||||
* @property {import("better-sqlite3/lib/database")} db
|
||||
* @property {import("matrix-appservice").AppService} as
|
||||
* @property {import("@cloudrac3r/in-your-element").AppService} as
|
||||
* @property {import("./db/orm").from} from
|
||||
* @property {import("./db/orm").select} select
|
||||
*/
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
// @ts-check
|
||||
|
||||
const { AppServiceRegistration } = require("matrix-appservice");
|
||||
|
||||
let id = AppServiceRegistration.generateToken()
|
||||
try {
|
||||
const reg = require("../matrix/read-registration")
|
||||
if (reg.id) id = reg.id
|
||||
} catch (e) {}
|
||||
|
||||
// creating registration files
|
||||
const newReg = new AppServiceRegistration(null);
|
||||
newReg.setAppServiceUrl("http://localhost:6693");
|
||||
newReg.setId(id);
|
||||
newReg.setHomeserverToken(AppServiceRegistration.generateToken());
|
||||
newReg.setAppServiceToken(AppServiceRegistration.generateToken());
|
||||
newReg.setSenderLocalpart("_ooye_bot");
|
||||
newReg.addRegexPattern("users", "@_ooye_.*", true);
|
||||
newReg.addRegexPattern("aliases", "#_ooye_.*", true);
|
||||
newReg.setProtocols(["discord"]); // For 3PID lookups
|
||||
newReg.setRateLimited(false);
|
||||
newReg.outputAsYaml("registration.yaml");
|
2
start.js
2
start.js
|
@ -17,7 +17,7 @@ const DiscordClient = require("./d2m/discord-client")
|
|||
const discord = new DiscordClient(config.discordToken, "full")
|
||||
passthrough.discord = discord
|
||||
|
||||
const as = require("./matrix/appservice")
|
||||
const {as} = require("./matrix/appservice")
|
||||
passthrough.as = as
|
||||
|
||||
const orm = sync.require("./db/orm")
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Loading…
Reference in a new issue