Compare commits
2 commits
f742d8572a
...
8c023cc936
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c023cc936 | |||
| e9fe820666 |
2 changed files with 18 additions and 2 deletions
|
|
@ -13,5 +13,5 @@ const {prompt} = require("enquirer")
|
||||||
|
|
||||||
reg.ooye.web_password = passwordResponse.web_password
|
reg.ooye.web_password = passwordResponse.web_password
|
||||||
writeRegistration(reg)
|
writeRegistration(reg)
|
||||||
console.log("Saved. Restart Out Of Your Element to apply this change.")
|
console.log("Saved. This change should be applied instantly.")
|
||||||
})()
|
})()
|
||||||
|
|
|
||||||
18
src/stdin.js
18
src/stdin.js
|
|
@ -23,10 +23,26 @@ const setPresence = sync.require("./d2m/actions/set-presence")
|
||||||
const channelWebhook = sync.require("./m2d/actions/channel-webhook")
|
const channelWebhook = sync.require("./m2d/actions/channel-webhook")
|
||||||
const guildID = "112760669178241024"
|
const guildID = "112760669178241024"
|
||||||
|
|
||||||
|
async function ping() {
|
||||||
|
const result = await api.ping().catch(e => ({ok: false, status: "net", root: e.message}))
|
||||||
|
if (result.ok) {
|
||||||
|
return "Ping OK. The homeserver and OOYE are talking to each other fine."
|
||||||
|
} else {
|
||||||
|
if (typeof result.root === "string") {
|
||||||
|
var msg = `Cannot reach homeserver: ${result.root}`
|
||||||
|
} else if (result.root.error) {
|
||||||
|
var msg = `Homeserver said: [${result.status}] ${result.root.error}`
|
||||||
|
} else {
|
||||||
|
var msg = `Homeserver said: [${result.status}] ${JSON.stringify(result.root)}`
|
||||||
|
}
|
||||||
|
return msg + "\nMatrix->Discord won't work until you fix this.\nIf your installation has recently changed, consider `npm run setup` again."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (process.stdin.isTTY) {
|
if (process.stdin.isTTY) {
|
||||||
setImmediate(() => {
|
setImmediate(() => {
|
||||||
if (!passthrough.repl) {
|
if (!passthrough.repl) {
|
||||||
const cli = repl.start({ prompt: "", eval: customEval, writer: s => s })
|
const cli = repl.start({prompt: "", eval: customEval, writer: s => s})
|
||||||
Object.assign(cli.context, passthrough)
|
Object.assign(cli.context, passthrough)
|
||||||
passthrough.repl = cli
|
passthrough.repl = cli
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue