diff --git a/src/discordcommandhandler.ts b/src/discordcommandhandler.ts index 9dfaaa6524c31453b43150e5b3bb2ff41e8780ee..eed2176ad5e50181a11ce616706675b06f3be5fc 100644 --- a/src/discordcommandhandler.ts +++ b/src/discordcommandhandler.ts @@ -69,7 +69,7 @@ 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!"; 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 27db1bf7638bbb3e583e4e5a0ec3dce9e21fae23..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.")); } } }; 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."); } });