From 26f2df2326e8cafaee1730ef1e433268fc1d19d2 Mon Sep 17 00:00:00 2001
From: Christian Paul <christianp@matrix.org>
Date: Tue, 12 Jan 2021 19:15:14 +0100
Subject: [PATCH] End sentences on a full stop

---
 src/discordcommandhandler.ts      | 2 +-
 src/matrixcommandhandler.ts       | 4 ++--
 src/provisioner.ts                | 4 ++--
 test/test_matrixcommandhandler.ts | 6 +++---
 test/test_provisioner.ts          | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/discordcommandhandler.ts b/src/discordcommandhandler.ts
index 9dfaaa6..eed2176 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 2dd9ec1..08bcb9f 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 27db1bf..633c4c9 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 9dc34cd..7f487f0 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 8b1a3b8..9d09939 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.");
             }
 
         });
-- 
GitLab