diff --git a/src/plugins/Slowmode.ts b/src/plugins/Slowmode.ts index 553493b7..0810e765 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; @@ -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 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 = [];