mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-11 20:55:01 +00:00
feat: new username support vol 2
This commit is contained in:
parent
ecaa16bf7c
commit
63c41f0278
29 changed files with 105 additions and 64 deletions
|
@ -3,7 +3,7 @@ import { GuildPluginData } from "knub";
|
|||
import { hasPermission } from "knub/helpers";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { DAYS, SECONDS, errorMessage, resolveMember, resolveUser } from "../../../utils";
|
||||
import { DAYS, SECONDS, errorMessage, renderUserUsername, resolveMember, resolveUser } from "../../../utils";
|
||||
import { IgnoredEventType, ModActionsPluginType } from "../types";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
|
||||
import { ignoreEvent } from "./ignoreEvent";
|
||||
|
@ -103,7 +103,7 @@ export async function actualKickMemberCmd(
|
|||
}
|
||||
|
||||
// Confirm the action to the moderator
|
||||
let response = `Kicked **${memberToKick.user.tag}** (Case #${kickResult.case.case_number})`;
|
||||
let response = `Kicked **${renderUserUsername(memberToKick.user)}** (Case #${kickResult.case.case_number})`;
|
||||
|
||||
if (kickResult.notifyResult.text) response += ` (${kickResult.notifyResult.text})`;
|
||||
sendSuccessMessage(pluginData, msg.channel, response);
|
||||
|
|
|
@ -4,7 +4,7 @@ import { GuildPluginData } from "knub";
|
|||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
|
||||
import { logger } from "../../../logger";
|
||||
import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { UnknownUser, asSingleLine, isDiscordAPIError } from "../../../utils";
|
||||
import { UnknownUser, asSingleLine, isDiscordAPIError, renderUserUsername } from "../../../utils";
|
||||
import { MutesPlugin } from "../../Mutes/MutesPlugin";
|
||||
import { MuteResult } from "../../Mutes/types";
|
||||
import { ModActionsPluginType } from "../types";
|
||||
|
@ -86,24 +86,24 @@ export async function actualMuteUserCmd(
|
|||
if (args.time) {
|
||||
if (muteResult.updatedExistingMute) {
|
||||
response = asSingleLine(`
|
||||
Updated **${user.tag}**'s
|
||||
Updated **${renderUserUsername(user)}**'s
|
||||
mute to ${timeUntilUnmute} (Case #${muteResult.case.case_number})
|
||||
`);
|
||||
} else {
|
||||
response = asSingleLine(`
|
||||
Muted **${user.tag}**
|
||||
Muted **${renderUserUsername(user)}**
|
||||
for ${timeUntilUnmute} (Case #${muteResult.case.case_number})
|
||||
`);
|
||||
}
|
||||
} else {
|
||||
if (muteResult.updatedExistingMute) {
|
||||
response = asSingleLine(`
|
||||
Updated **${user.tag}**'s
|
||||
Updated **${renderUserUsername(user)}**'s
|
||||
mute to indefinite (Case #${muteResult.case.case_number})
|
||||
`);
|
||||
} else {
|
||||
response = asSingleLine(`
|
||||
Muted **${user.tag}**
|
||||
Muted **${renderUserUsername(user)}**
|
||||
indefinitely (Case #${muteResult.case.case_number})
|
||||
`);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import humanizeDuration from "humanize-duration";
|
|||
import { GuildPluginData } from "knub";
|
||||
import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin";
|
||||
import { UnknownUser, asSingleLine } from "../../../utils";
|
||||
import { UnknownUser, asSingleLine, renderUserUsername } from "../../../utils";
|
||||
import { ModActionsPluginType } from "../types";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
|
||||
|
||||
|
@ -48,7 +48,7 @@ export async function actualUnmuteCmd(
|
|||
pluginData,
|
||||
msg.channel,
|
||||
asSingleLine(`
|
||||
Unmuting **${user.tag}**
|
||||
Unmuting **${renderUserUsername(user)}**
|
||||
in ${timeUntilUnmute} (Case #${result.case.case_number})
|
||||
`),
|
||||
);
|
||||
|
@ -57,7 +57,7 @@ export async function actualUnmuteCmd(
|
|||
pluginData,
|
||||
msg.channel,
|
||||
asSingleLine(`
|
||||
Unmuted **${user.tag}**
|
||||
Unmuted **${renderUserUsername(user)}**
|
||||
(Case #${result.case.case_number})
|
||||
`),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue