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

This commit is contained in:
Dragory 2020-08-01 23:53:58 +03:00
commit 88b8573f5a
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
4 changed files with 15 additions and 8 deletions

View file

@ -46,7 +46,7 @@ export const UnmuteCmd = modActionsCommand({
}
if (!memberToUnmute) {
const banned = await isBanned(pluginData, memberToUnmute.id);
const banned = await isBanned(pluginData, user.id);
const prefix = pluginData.guildConfig.prefix;
if (banned) {
sendErrorMessage(

View file

@ -2,7 +2,14 @@ import { PluginData } from "knub";
import { MuteOptions, MutesPluginType } from "../types";
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
import humanizeDuration from "humanize-duration";
import { notifyUser, resolveUser, stripObjectToScalars, ucfirst, UserNotificationResult } from "../../../utils";
import {
notifyUser,
resolveUser,
stripObjectToScalars,
ucfirst,
UserNotificationResult,
resolveMember,
} from "../../../utils";
import { renderTemplate } from "../../../templateFormatter";
import { TextChannel, User } from "eris";
import { CasesPlugin } from "../../Cases/CasesPlugin";
@ -33,7 +40,7 @@ export async function muteUser(
}
const user = await resolveUser(pluginData.client, userId);
const member = await pluginData.client.getRESTGuildMember(pluginData.guild.id, user.id); // Grab the fresh member so we don't have stale role info
const member = await resolveMember(pluginData.client, pluginData.guild, user.id); // Grab the fresh member so we don't have stale role info
const config = pluginData.config.getMatchingConfig({ member, userId });
if (member) {

View file

@ -1,7 +1,7 @@
import { PluginData } from "knub";
import { MutesPluginType, UnmuteResult } from "../types";
import { CaseArgs } from "../../Cases/types";
import { resolveUser, stripObjectToScalars } from "../../../utils";
import { resolveUser, stripObjectToScalars, resolveMember } from "../../../utils";
import { memberHasMutedRole } from "./memberHasMutedRole";
import humanizeDuration from "humanize-duration";
import { CasesPlugin } from "../../Cases/CasesPlugin";
@ -16,7 +16,7 @@ export async function unmuteUser(
): Promise<UnmuteResult> {
const existingMute = await pluginData.state.mutes.findExistingMuteForUserId(userId);
const user = await resolveUser(pluginData.client, userId);
const member = await pluginData.client.getRESTGuildMember(pluginData.guild.id, userId); // Grab the fresh member so we don't have stale role info
const member = await resolveMember(pluginData.client, pluginData.guild, userId); // Grab the fresh member so we don't have stale role info
if (!existingMute && !memberHasMutedRole(pluginData, member)) return;

View file

@ -2880,9 +2880,9 @@
"dev": true
},
"elliptic": {
"version": "6.5.1",
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz",
"integrity": "sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==",
"version": "6.5.3",
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
"integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
"dev": true,
"requires": {
"bn.js": "^4.4.0",