Typed log functions + more
This commit is contained in:
parent
d2ac700143
commit
bed6589d48
166 changed files with 4021 additions and 869 deletions
|
@ -1,7 +1,7 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { userToConfigAccessibleUser } from "../../../utils/configAccessibleObjects";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { resolveMember, resolveUser } from "../../../utils";
|
||||
|
@ -10,6 +10,7 @@ import { CasesPlugin } from "../../Cases/CasesPlugin";
|
|||
import { CaseArgs } from "../../Cases/types";
|
||||
import { MutesPluginType, UnmuteResult } from "../types";
|
||||
import { memberHasMutedRole } from "./memberHasMutedRole";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
|
||||
export async function unmuteUser(
|
||||
pluginData: GuildPluginData<MutesPluginType>,
|
||||
|
@ -87,17 +88,17 @@ export async function unmuteUser(
|
|||
// Log the action
|
||||
const mod = await pluginData.client.users.fetch(modId as Snowflake);
|
||||
if (unmuteTime) {
|
||||
pluginData.state.serverLogs.log(LogType.MEMBER_TIMED_UNMUTE, {
|
||||
mod: userToConfigAccessibleUser(mod),
|
||||
user: userToConfigAccessibleUser(user),
|
||||
pluginData.getPlugin(LogsPlugin).logMemberTimedUnmute({
|
||||
mod,
|
||||
user,
|
||||
caseNumber: createdCase.case_number,
|
||||
time: timeUntilUnmute,
|
||||
reason: caseArgs.reason,
|
||||
});
|
||||
} else {
|
||||
pluginData.state.serverLogs.log(LogType.MEMBER_UNMUTE, {
|
||||
mod: userToConfigAccessibleUser(mod),
|
||||
user: userToConfigAccessibleUser(user),
|
||||
pluginData.getPlugin(LogsPlugin).logMemberUnmute({
|
||||
mod,
|
||||
user,
|
||||
caseNumber: createdCase.case_number,
|
||||
reason: caseArgs.reason,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue