add appservice listener
This commit is contained in:
8
m2d/appservice.js
Normal file
8
m2d/appservice.js
Normal file
@@ -0,0 +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))
|
||||
|
||||
module.exports = as
|
8
m2d/event-dispatcher.js
Normal file
8
m2d/event-dispatcher.js
Normal file
@@ -0,0 +1,8 @@
|
||||
const assert = require("assert").strict
|
||||
const {sync, as} = require("../passthrough")
|
||||
|
||||
// Grab Matrix events we care about for the bridge, check them, and pass them on
|
||||
|
||||
sync.addTemporaryListener(as, "type:m.room.message", event => {
|
||||
console.log(event)
|
||||
})
|
Reference in New Issue
Block a user