3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 14:11:50 +00:00

Merge branch 'master' of github.com:Dragory/ZeppelinBot

This commit is contained in:
Dragory 2019-04-18 08:46:03 +03:00
commit b76f87bbef
2 changed files with 3 additions and 3 deletions

View file

@ -7,7 +7,7 @@ import { ZeppelinPlugin } from "./ZeppelinPlugin";
import { SavedMessage } from "../data/entities/SavedMessage"; import { SavedMessage } from "../data/entities/SavedMessage";
import { GuildSavedMessages } from "../data/GuildSavedMessages"; 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 { interface ISlowmodePluginConfig {
use_native_slowmode: boolean; use_native_slowmode: boolean;
@ -288,7 +288,7 @@ export class SlowmodePlugin extends ZeppelinPlugin<ISlowmodePluginConfig> {
// Make sure this user is affected by the slowmode // Make sure this user is affected by the slowmode
const member = this.guild.members.get(msg.user_id); 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(); if (!isAffected) return thisMsgLock.unlock();
// Check if this channel even *has* a bot-maintained slowmode // Check if this channel even *has* a bot-maintained slowmode

View file

@ -219,7 +219,7 @@ export function parseTemplate(str: string): ParsedTemplate {
} }
async function evaluateTemplateVariable(theVar: ITemplateVar, values) { 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") { if (typeof value === "function") {
const args = []; const args = [];