diff --git a/src/discordcommandhandler.ts b/src/discordcommandhandler.ts index e0de744c5918085b58ca31d1241caecd785ae0b2..f1d5fda0244c42b77e6c348a2093bfa695637682 100644 --- a/src/discordcommandhandler.ts +++ b/src/discordcommandhandler.ts @@ -50,10 +50,10 @@ export class DiscordCommandHandler { permission: "MANAGE_WEBHOOKS", run: async () => { if (await this.discord.Provisioner.MarkApproved(chan, discordMember, true)) { - return "Thanks for your response! The matrix bridge has been approved"; + return "Thanks for your response! The matrix bridge has been approved."; } else { return "Thanks for your response, however" + - "the time for responses has expired - sorry!"; + " it has arrived after the deadline - sorry!"; } }, }, @@ -69,10 +69,10 @@ export class DiscordCommandHandler { permission: "MANAGE_WEBHOOKS", run: async () => { if (await this.discord.Provisioner.MarkApproved(chan, discordMember, false)) { - return "Thanks for your response! The matrix bridge has been declined"; + return "Thanks for your response! The matrix bridge has been declined."; } else { return "Thanks for your response, however" + - "the time for responses has expired - sorry!"; + " it has arrived after the deadline - sorry!"; } }, }, diff --git a/src/matrixcommandhandler.ts b/src/matrixcommandhandler.ts index 2dd9ec170566b6552376fab9b7758e0a1eb84f28..08bcb9fb8c8d5a4fa676faa3f9bf8c6c73378cf9 100644 --- a/src/matrixcommandhandler.ts +++ b/src/matrixcommandhandler.ts @@ -97,8 +97,8 @@ export class MatrixCommandHandler { await this.provisioner.BridgeMatrixRoom(channel, event.room_id); return "I have bridged this room to your channel"; } catch (err) { - if (err.message === "Timed out waiting for a response from the Discord owners" - || err.message === "The bridge has been declined by the Discord guild") { + if (err.message === "Timed out waiting for a response from the Discord owners." + || err.message === "The bridge has been declined by the Discord guild.") { return err.message; } diff --git a/src/provisioner.ts b/src/provisioner.ts index 54de31d4ce28d15abeb0121ffc15a06d61b41ea0..633c4c908e27cceb5ec3eee254792fc707ca8821 100644 --- a/src/provisioner.ts +++ b/src/provisioner.ts @@ -89,9 +89,9 @@ export class Provisioner { resolve("Approved"); } else { if (expired) { - reject(Error("Timed out waiting for a response from the Discord owners")); + reject(Error("Timed out waiting for a response from the Discord owners.")); } else { - reject(Error("The bridge has been declined by the Discord guild")); + reject(Error("The bridge has been declined by the Discord guild.")); } } }; @@ -100,7 +100,7 @@ export class Provisioner { setTimeout(() => approveFn(false, true), timeout); await channel.send(`${requestor} on matrix would like to bridge this channel. Someone with permission` + - " to manage webhooks please reply with `!matrix approve` or `!matrix deny` in the next 5 minutes"); + " to manage webhooks please reply with `!matrix approve` or `!matrix deny` in the next 5 minutes."); return await deferP; } diff --git a/test/test_matrixcommandhandler.ts b/test/test_matrixcommandhandler.ts index 9dc34cd85234f5506fb5055d79c9035cc0b26f0f..7f487f0a78d32b8c9225aef3b86f08aa8c3d74f5 100644 --- a/test/test_matrixcommandhandler.ts +++ b/test/test_matrixcommandhandler.ts @@ -40,7 +40,7 @@ function createCH(opts: any = {}, shouldBeJoined = true) { const provisioner = { AskBridgePermission: async () => { if (opts.denyBridgePermission) { - throw new Error("The bridge has been declined by the Discord guild"); + throw new Error("The bridge has been declined by the Discord guild."); } }, BridgeMatrixRoom: () => { @@ -151,8 +151,8 @@ describe("MatrixCommandHandler", () => { denyBridgePermission: true, }); await handler.Process(createEvent("!discord bridge 123 456"), createContext()); - const expected = "The bridge has been declined by the Discord guild"; - const expectedHtml = "<p>The bridge has been declined by the Discord guild</p>\n"; + const expected = "The bridge has been declined by the Discord guild."; + const expectedHtml = "<p>The bridge has been declined by the Discord guild.</p>\n"; bridge.botIntent.underlyingClient.wasCalled("sendMessage", true, "!123:localhost", { body: expected, format: "org.matrix.custom.html", diff --git a/test/test_provisioner.ts b/test/test_provisioner.ts index 8b1a3b8d7e3adcb48f3a9aeaedf550f46c40d056..9d09939a0f25b7797d83413cfd1db7ec8d3f9ad3 100644 --- a/test/test_provisioner.ts +++ b/test/test_provisioner.ts @@ -37,7 +37,7 @@ describe("Provisioner", () => { ); throw Error("Should have thrown an error"); } catch (err) { - expect(err.message).to.eq("Timed out waiting for a response from the Discord owners"); + expect(err.message).to.eq("Timed out waiting for a response from the Discord owners."); const delay = Date.now() - startAt; if (delay < TIMEOUT_MS) { throw Error(`Should have waited for timeout before resolving, waited: ${delay}ms`); @@ -56,7 +56,7 @@ describe("Provisioner", () => { await promise; throw Error("Should have thrown an error"); } catch (err) { - expect(err.message).to.eq("The bridge has been declined by the Discord guild"); + expect(err.message).to.eq("The bridge has been declined by the Discord guild."); } });