diff --git a/README.md b/README.md index 95a98c0..af9a013 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,10 @@ Feel free to make a issue for each requested feature so when I finally get time Currently implemented commands: -- `evacuate ?<--preserve | -p>` +- `evacuate ?<--preserve | -p>` - Runs the [evacuate room endpoint](https://matrix-org.github.io/dendrite/administration/adminapi#post-_dendriteadminevacuateroomroomid) on that roomID or Alias. If the `--preserve` or `-p` flag is **not** provided the [purge room endpoint](https://matrix-org.github.io/dendrite/administration/adminapi#post-_dendriteadminpurgeroomroomid) will also be run, purging the room state from the database. + - When supplied a room ID or alias, the interface runs the [evacuate room endpoint](https://matrix-org.github.io/dendrite/administration/adminapi#post-_dendriteadminevacuateroomroomid) on that roomID or Alias, causing all users on this server to leave that room. If the `--preserve` or `-p` flag is **not** provided the [purge room endpoint](https://matrix-org.github.io/dendrite/administration/adminapi#post-_dendriteadminpurgeroomroomid) will also be run, purging the room state from the database. + - When supplied with a MXID of a local user, i.e. `@localpart:your.server`, the interface will run the [evacuate user endpoint](https://matrix-org.github.io/dendrite/administration/adminapi#post-_dendriteadminevacuateuseruserid) on that user, making that account leave all rooms it is in. Space: [#admin-interface:pain.agency](https://matrix.to/#/#admin-interface:pain.agency) Discussion Room: [#admin-interface-support:pain.agency](https://matrix.to/#/%23admin-interface-support%3Apain.agency) \ No newline at end of file diff --git a/index.js b/index.js index bc188dd..cd4ca4d 100644 --- a/index.js +++ b/index.js @@ -129,7 +129,9 @@ async function makeDendriteReq (reqType, command, arg1, arg2, body) { async function evacuateUser(mxid){ - + makeDendriteReq("POST", "evacuateUser", mxid) + .then(e => client.sendHtmlNotice(adminRoom, ("Ran evacuateUser endpoint on "+ mxid + " with response
" + e + "
")) ) + .catch(e => client.sendHtmlNotice(adminRoom, ("❌ | could not make evacuateUser request with error\n
" + e + "
")) ) }