Compare commits
No commits in common. "7e9005216d316c0f3bb9b8867d75185bfade61ee" and "2c3b653b540e6eea37e130104aece48c1f094d71" have entirely different histories.
7e9005216d
...
2c3b653b54
9 changed files with 684 additions and 2794 deletions
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -1,8 +1,8 @@
|
||||||
// @ts-check
|
|
||||||
|
|
||||||
const reg = require("../matrix/read-registration")
|
const reg = require("../matrix/read-registration")
|
||||||
const {AppService} = require("@cloudrac3r/in-your-element")
|
const AppService = require("matrix-appservice").AppService
|
||||||
const as = new AppService(reg)
|
const as = new AppService({
|
||||||
as.listen()
|
homeserverToken: reg.hs_token
|
||||||
|
})
|
||||||
|
as.listen(+(new URL(reg.url).port))
|
||||||
|
|
||||||
module.exports.as = as
|
module.exports = as
|
||||||
|
|
802
package-lock.json
generated
802
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -19,7 +19,6 @@
|
||||||
"@cloudrac3r/discord-markdown": "^2.6.2",
|
"@cloudrac3r/discord-markdown": "^2.6.2",
|
||||||
"@cloudrac3r/giframe": "^0.4.3",
|
"@cloudrac3r/giframe": "^0.4.3",
|
||||||
"@cloudrac3r/html-template-tag": "^5.0.1",
|
"@cloudrac3r/html-template-tag": "^5.0.1",
|
||||||
"@cloudrac3r/in-your-element": "^1.0.0",
|
|
||||||
"@cloudrac3r/mixin-deep": "^3.0.0",
|
"@cloudrac3r/mixin-deep": "^3.0.0",
|
||||||
"@cloudrac3r/pngjs": "^7.0.3",
|
"@cloudrac3r/pngjs": "^7.0.3",
|
||||||
"@cloudrac3r/turndown": "^7.1.4",
|
"@cloudrac3r/turndown": "^7.1.4",
|
||||||
|
@ -31,6 +30,7 @@
|
||||||
"get-stream": "^6.0.1",
|
"get-stream": "^6.0.1",
|
||||||
"heatsync": "^2.5.3",
|
"heatsync": "^2.5.3",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
|
"matrix-appservice": "^2.0.0",
|
||||||
"minimist": "^1.2.8",
|
"minimist": "^1.2.8",
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^2.6.7",
|
||||||
"prettier-bytes": "^1.0.4",
|
"prettier-bytes": "^1.0.4",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* @property {import("./d2m/discord-client")} discord
|
* @property {import("./d2m/discord-client")} discord
|
||||||
* @property {import("heatsync").default} sync
|
* @property {import("heatsync").default} sync
|
||||||
* @property {import("better-sqlite3/lib/database")} db
|
* @property {import("better-sqlite3/lib/database")} db
|
||||||
* @property {import("@cloudrac3r/in-your-element").AppService} as
|
* @property {import("matrix-appservice").AppService} as
|
||||||
* @property {import("./db/orm").from} from
|
* @property {import("./db/orm").from} from
|
||||||
* @property {import("./db/orm").select} select
|
* @property {import("./db/orm").select} select
|
||||||
*/
|
*/
|
||||||
|
|
22
scripts/register.js
Normal file
22
scripts/register.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
// @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")
|
const discord = new DiscordClient(config.discordToken, "full")
|
||||||
passthrough.discord = discord
|
passthrough.discord = discord
|
||||||
|
|
||||||
const {as} = require("./matrix/appservice")
|
const as = require("./matrix/appservice")
|
||||||
passthrough.as = as
|
passthrough.as = as
|
||||||
|
|
||||||
const orm = sync.require("./db/orm")
|
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…
Add table
Add a link
Reference in a new issue