mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-07-01 00:51:36 +00:00
Actually reply to status commands
This commit is contained in:
parent
02288a3885
commit
4d16ff3e51
|
@ -25,7 +25,7 @@ export function handleCommand(roomId: string, event: any, mjolnir: Mjolnir) {
|
|||
const cmd = event['content']['body'];
|
||||
const parts = cmd.trim().split(' ');
|
||||
|
||||
if (parts.length === 1) {
|
||||
if (parts.length === 1 || parts[1] === 'status') {
|
||||
return execStatusCommand(roomId, event, mjolnir);
|
||||
} else if (parts[1] === 'ban' && parts.length > 3) {
|
||||
return execBanCommand(roomId, event, mjolnir, parts);
|
||||
|
|
|
@ -15,6 +15,7 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
import { Mjolnir } from "../Mjolnir";
|
||||
import { RichReply } from "matrix-bot-sdk";
|
||||
|
||||
// !mjolnir
|
||||
export async function execStatusCommand(roomId: string, event: any, mjolnir: Mjolnir) {
|
||||
|
@ -37,11 +38,7 @@ export async function execStatusCommand(roomId: string, event: any, mjolnir: Mjo
|
|||
}
|
||||
html += "</ul>";
|
||||
|
||||
const message = {
|
||||
msgtype: "m.notice",
|
||||
body: text,
|
||||
format: "org.matrix.custom.html",
|
||||
formatted_body: html,
|
||||
};
|
||||
return mjolnir.client.sendMessage(roomId, message);
|
||||
const reply = RichReply.createFor(roomId, event, text, html);
|
||||
reply["msgtype"] = "m.notice";
|
||||
return mjolnir.client.sendMessage(roomId, reply);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user