mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 20:35:02 +00:00
More fixes, change rest of stripObjectToScalars to configAccessibleObj
This commit is contained in:
parent
4ad99975de
commit
acb4913495
66 changed files with 623 additions and 192 deletions
|
@ -1,9 +1,10 @@
|
|||
import { Snowflake, TextChannel } from "discord.js";
|
||||
import { Snowflake, TextChannel, User } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { deactivateMentions, disableCodeBlocks } from "knub/dist/helpers";
|
||||
import { channelToConfigAccessibleChannel, userToConfigAccessibleUser } from "src/utils/configAccessibleObjects";
|
||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { resolveUser, stripObjectToScalars } from "../../../utils";
|
||||
import { resolveUser } from "../../../utils";
|
||||
import { CensorPluginType } from "../types";
|
||||
|
||||
export async function censorMessage(
|
||||
|
@ -21,11 +22,11 @@ export async function censorMessage(
|
|||
}
|
||||
|
||||
const user = await resolveUser(pluginData.client, savedMessage.user_id);
|
||||
const channel = pluginData.guild.channels.cache.get(savedMessage.channel_id as Snowflake);
|
||||
const channel = pluginData.guild.channels.resolve(savedMessage.channel_id as Snowflake)!;
|
||||
|
||||
pluginData.state.serverLogs.log(LogType.CENSOR, {
|
||||
user: stripObjectToScalars(user),
|
||||
channel: stripObjectToScalars(channel),
|
||||
user: userToConfigAccessibleUser(user),
|
||||
channel: channelToConfigAccessibleChannel(channel),
|
||||
reason,
|
||||
message: savedMessage,
|
||||
messageText: disableCodeBlocks(deactivateMentions(savedMessage.data.content)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue