From 2fda98db449cdcdc9ab980e469264ce3f2ac657d Mon Sep 17 00:00:00 2001 From: Miikka Date: Mon, 15 Apr 2019 14:01:49 +0300 Subject: [PATCH 1/3] Fix slowmodes longer than 6h --- src/plugins/Slowmode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/Slowmode.ts b/src/plugins/Slowmode.ts index 553493b7..196e6944 100644 --- a/src/plugins/Slowmode.ts +++ b/src/plugins/Slowmode.ts @@ -7,7 +7,7 @@ import { ZeppelinPlugin } from "./ZeppelinPlugin"; import { SavedMessage } from "../data/entities/SavedMessage"; import { GuildSavedMessages } from "../data/GuildSavedMessages"; -const NATIVE_SLOWMODE_LIMIT = 6 * 60 * 60 * 1000; // 6 hours +const NATIVE_SLOWMODE_LIMIT = 6 * 60 * 60; // 6 hours interface ISlowmodePluginConfig { use_native_slowmode: boolean; From 91a713b3aa3d3e64d916f7d501684c669af90a92 Mon Sep 17 00:00:00 2001 From: Miikka Date: Mon, 15 Apr 2019 14:11:58 +0300 Subject: [PATCH 2/3] Fix bot-maintained slowmodes not being applied --- src/plugins/Slowmode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/Slowmode.ts b/src/plugins/Slowmode.ts index 196e6944..0810e765 100644 --- a/src/plugins/Slowmode.ts +++ b/src/plugins/Slowmode.ts @@ -288,7 +288,7 @@ export class SlowmodePlugin extends ZeppelinPlugin { // Make sure this user is affected by the slowmode const member = this.guild.members.get(msg.user_id); - const isAffected = this.hasPermission("affected", { channelId: channel.id, userId: msg.user_id, member }); + const isAffected = this.hasPermission("is_affected", { channelId: channel.id, userId: msg.user_id, member }); if (!isAffected) return thisMsgLock.unlock(); // Check if this channel even *has* a bot-maintained slowmode From f01fbafb4433fe1ee61b729e5eb1df02c0d68ceb Mon Sep 17 00:00:00 2001 From: Miikka Date: Wed, 17 Apr 2019 09:43:27 +0300 Subject: [PATCH 3/3] templateFormatter: fix unknown values showing up as "false" --- src/templateFormatter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templateFormatter.ts b/src/templateFormatter.ts index d0637daa..1062c6ef 100644 --- a/src/templateFormatter.ts +++ b/src/templateFormatter.ts @@ -219,7 +219,7 @@ export function parseTemplate(str: string): ParsedTemplate { } async function evaluateTemplateVariable(theVar: ITemplateVar, values) { - const value = has(values, theVar.identifier) && at(values, theVar.identifier)[0]; + let value = has(values, theVar.identifier) ? at(values, theVar.identifier)[0] : undefined; if (typeof value === "function") { const args = [];