diff --git a/src/appservice/bot/ListCommand.tsx b/src/appservice/bot/ListCommand.tsx index f6a2a4fd..536f4a30 100644 --- a/src/appservice/bot/ListCommand.tsx +++ b/src/appservice/bot/ListCommand.tsx @@ -52,7 +52,7 @@ defineMatrixInterfaceAdaptor({ {draupnir.clientUserID} {draupnir.failType}:
- {draupnir.cause} + {String(draupnir.cause)} })} diff --git a/src/capabilities/CommonRenderers.tsx b/src/capabilities/CommonRenderers.tsx index e16f0225..c6d98767 100644 --- a/src/capabilities/CommonRenderers.tsx +++ b/src/capabilities/CommonRenderers.tsx @@ -128,9 +128,9 @@ export function renderResultForUsersInRoom(results: ResultForUsersInRoom, { summ return
{summary}
} diff --git a/src/commands/Help.tsx b/src/commands/Help.tsx index 4c25217f..d17a08ce 100644 --- a/src/commands/Help.tsx +++ b/src/commands/Help.tsx @@ -40,7 +40,7 @@ function renderTableHelp(table: CommandTable): DocumentNode { return Documentation: {DOCUMENTATION_URL}
- {table.name} commands: + {table.name.toString()} commands: {table.getExportedCommands().map(renderCommandSummary)} {table.getImportedTables().map(renderTableHelp)}
diff --git a/src/commands/KickCommand.tsx b/src/commands/KickCommand.tsx index 9e62e019..da9c2a57 100644 --- a/src/commands/KickCommand.tsx +++ b/src/commands/KickCommand.tsx @@ -51,14 +51,14 @@ function renderUsersToKick(usersToKick: UsersToKick): DocumentNode { Kicking {usersToKick.size} unique users from protected rooms. - {[...usersToKick.entries()].map(([userID, rooms]) => { + {[...usersToKick.entries()].map(([userID, rooms]) =>
Kicking {userID} from {rooms.length} rooms.
- })} + )}
} diff --git a/src/commands/ProtectionsCommands.tsx b/src/commands/ProtectionsCommands.tsx index 9d3b9350..494bcd4a 100644 --- a/src/commands/ProtectionsCommands.tsx +++ b/src/commands/ProtectionsCommands.tsx @@ -230,7 +230,7 @@ function renderSettingChangeSummary(summary: SettingChangeSummary): DocumentNode const oldJSON = summary.description.toJSON({ [summary.description.key]: summary.oldValue }); const newJSON = summary.description.toJSON({ [summary.description.key]: summary.newValue }); return - Setting {summary.description.key} changed from {oldJSON} to {newJSON} + Setting {summary.description.key} changed from {JSON.stringify(oldJSON)} to {JSON.stringify(newJSON)} } diff --git a/src/commands/ResolveAlias.tsx b/src/commands/ResolveAlias.tsx index 01fecf13..d7189fbc 100644 --- a/src/commands/ResolveAlias.tsx +++ b/src/commands/ResolveAlias.tsx @@ -31,7 +31,7 @@ import { resolveRoomReferenceSafe } from "matrix-protection-suite-for-matrix-bot import { defineInterfaceCommand, findTableCommand } from "./interface-manager/InterfaceCommand"; import { ParsedKeywords, findPresentationType, parameters } from "./interface-manager/ParameterParsing"; import { defineMatrixInterfaceAdaptor } from "./interface-manager/MatrixInterfaceAdaptor"; -import { tickCrossRenderer } from "./interface-manager/MatrixHelpRenderer"; +import { renderRoomPill, tickCrossRenderer } from "./interface-manager/MatrixHelpRenderer"; import { renderMatrixAndSend } from "./interface-manager/DeadDocumentMatrix"; import { JSXFactory } from "./interface-manager/JSXFactory"; @@ -62,7 +62,7 @@ defineMatrixInterfaceAdaptor({ return; } await renderMatrixAndSend( - {result.ok}, + {result.ok.toRoomIDOrAlias()} - {renderRoomPill(result.ok)}, commandRoomID, event, client diff --git a/src/commands/interface-manager/MatrixHelpRenderer.tsx b/src/commands/interface-manager/MatrixHelpRenderer.tsx index fe2938ec..05c0a91e 100644 --- a/src/commands/interface-manager/MatrixHelpRenderer.tsx +++ b/src/commands/interface-manager/MatrixHelpRenderer.tsx @@ -40,13 +40,13 @@ export function renderCommandSummary(command: InterfaceCommand): D {command.description ? Description:
{command.description}
- : [] + : } {command.argumentListParser.descriptions.length > 0 ? Parameters:
{...command.argumentListParser.descriptions.map(renderParameterDescription)}
- : [] + : } } @@ -70,7 +70,7 @@ function renderTableHelp(table: CommandTable): DocumentNode { } return
- {tableName} commands: + {tableName.toString()} commands: {table.getExportedCommands().map(renderCommandSummary)} {table.getImportedTables().map(renderTableHelp)}
diff --git a/src/commands/interface-manager/MatrixPromptForAccept.tsx b/src/commands/interface-manager/MatrixPromptForAccept.tsx index 6e623be0..bba7c8e0 100644 --- a/src/commands/interface-manager/MatrixPromptForAccept.tsx +++ b/src/commands/interface-manager/MatrixPromptForAccept.tsx @@ -14,6 +14,7 @@ import { MatrixReactionHandler, ReactionListener } from "./MatrixReactionHandler import { StaticDecode, Type } from "@sinclair/typebox"; import { ReadItem, readCommand } from "./CommandReader"; import { printReadably } from "./PrintReadably"; +import { DeadDocumentPresentationMirror } from "./DeadDocumentPresentation"; const log = new Logger('MatrixPromptForAccept'); @@ -143,7 +144,7 @@ export async function promptDefault( const events = await renderMatrixAndSend( No argument was provided for the parameter {parameter.name}, would you like to accept the default?
- {defaultPrompt} + {DeadDocumentPresentationMirror.present(defaultPrompt)}
, this.roomID, this.event, this.client, this.reactionHandler.createAnnotation( @@ -181,7 +182,7 @@ export async function promptSuggestions(
    {suggestions.map((suggestion) => { return
  1. - {suggestion} + {DeadDocumentPresentationMirror.present(suggestion)}
  2. })}
diff --git a/src/protections/BanPropagation.tsx b/src/protections/BanPropagation.tsx index 53e8d792..2aca6ec3 100644 --- a/src/protections/BanPropagation.tsx +++ b/src/protections/BanPropagation.tsx @@ -33,7 +33,7 @@ import { renderMatrixAndSend } from "../commands/interface-manager/DeadDocumentM import { renderMentionPill, renderRoomPill } from "../commands/interface-manager/MatrixHelpRenderer"; import { ListMatches, renderListRules } from "../commands/Rules"; import { printActionResult } from "../models/RoomUpdateError"; -import { AbstractProtection, ActionResult, Logger, MatrixRoomID, MatrixRoomReference, MembershipChange, MembershipChangeType, Ok, PermissionError, PolicyRule, PolicyRuleType, ProtectedRoomsSet, ProtectionDescription, Recommendation, RoomActionError, RoomMembershipRevision, RoomUpdateError, StringRoomID, StringUserID, Task, describeProtection, isError, serverName, UserID, UnknownSettings, UserConsequences, Membership } from "matrix-protection-suite"; +import { AbstractProtection, ActionResult, Logger, MatrixRoomID, MatrixRoomReference, MembershipChange, MembershipChangeType, Ok, PermissionError, PolicyRule, PolicyRuleType, ProtectedRoomsSet, ProtectionDescription, Recommendation, RoomActionError, RoomMembershipRevision, RoomUpdateError, StringRoomID, StringUserID, Task, describeProtection, isError, serverName, UnknownSettings, UserConsequences, Membership } from "matrix-protection-suite"; import { Draupnir } from "../Draupnir"; import { resolveRoomReferenceSafe } from "matrix-protection-suite-for-matrix-bot-sdk"; import { DraupnirProtection } from "./Protection"; @@ -76,7 +76,7 @@ async function promptBanPropagation( const reactionMap = makePolicyRoomReactionReferenceMap(editablePolicyRoomIDs); const promptEventId = (await renderMatrixAndSend( The user {renderMentionPill(change.userID, change.content.displayname ?? change.userID)} was banned - in {change.roomID} by {new UserID(change.sender)} for {change.content.reason ?? ''}.
+ in {change.roomID} by {renderMentionPill(change.sender, change.sender)} for {change.content.reason ?? ''}.
Would you like to add the ban to a policy list?
    {editablePolicyRoomIDs.map((room) =>
  1. {room.toRoomIDOrAlias()}
  2. )}