Skip to content
Extraits de code Groupes Projets
Valider 26f2df23 rédigé par Christian Paul's avatar Christian Paul
Parcourir les fichiers

End sentences on a full stop

parent 5ef4bb55
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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!";
......
......@@ -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;
}
......
......@@ -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."));
}
}
};
......
......@@ -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",
......
......@@ -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.");
}
});
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter