3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Typed log functions + more

This commit is contained in:
Dragory 2021-08-18 01:51:42 +03:00
parent d2ac700143
commit bed6589d48
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
166 changed files with 4021 additions and 869 deletions

View file

@ -1,13 +1,14 @@
import { VoiceChannel } from "discord.js";
import {
channelToConfigAccessibleChannel,
memberToConfigAccessibleMember,
userToConfigAccessibleUser,
} from "../../../utils/configAccessibleObjects";
channelToTemplateSafeChannel,
memberToTemplateSafeMember,
userToTemplateSafeUser,
} from "../../../utils/templateSafeObjects";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { LogType } from "../../../data/LogType";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { utilityCmd } from "../types";
import { LogsPlugin } from "../../Logs/LogsPlugin";
export const VcdisconnectCmd = utilityCmd({
trigger: ["vcdisconnect", "vcdisc", "vcdc", "vckick", "vck"],
@ -38,10 +39,10 @@ export const VcdisconnectCmd = utilityCmd({
return;
}
pluginData.state.logs.log(LogType.VOICE_CHANNEL_FORCE_DISCONNECT, {
mod: userToConfigAccessibleUser(msg.author),
member: memberToConfigAccessibleMember(args.member),
oldChannel: channelToConfigAccessibleChannel(channel),
pluginData.getPlugin(LogsPlugin).logVoiceChannelForceDisconnect({
mod: msg.author,
member: args.member,
oldChannel: channel,
});
sendSuccessMessage(pluginData, msg.channel, `**${args.member.user.tag}** disconnected from **${channel.name}**`);