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
|
@ -2,6 +2,7 @@ import { Channel, Message, TextChannel } from "discord.js";
|
|||
import humanizeDuration from "humanize-duration";
|
||||
import { GuildPluginData } from "knub";
|
||||
import moment from "moment-timezone";
|
||||
import { channelToConfigAccessibleChannel, userToConfigAccessibleUser } from "src/utils/configAccessibleObjects";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { DBDateFormat, errorMessage, MINUTES, StrictMessageContent, stripObjectToScalars } from "../../../utils";
|
||||
|
@ -158,8 +159,8 @@ export async function actualPostCmd(
|
|||
|
||||
if (opts.repeat) {
|
||||
pluginData.state.logs.log(LogType.SCHEDULED_REPEATED_MESSAGE, {
|
||||
author: stripObjectToScalars(msg.author),
|
||||
channel: stripObjectToScalars(targetChannel),
|
||||
author: userToConfigAccessibleUser(msg.author),
|
||||
channel: channelToConfigAccessibleChannel(targetChannel),
|
||||
datetime: postAt.format(timeAndDate.getDateFormat("pretty_datetime")),
|
||||
date: postAt.format(timeAndDate.getDateFormat("date")),
|
||||
time: postAt.format(timeAndDate.getDateFormat("time")),
|
||||
|
@ -168,8 +169,8 @@ export async function actualPostCmd(
|
|||
});
|
||||
} else {
|
||||
pluginData.state.logs.log(LogType.SCHEDULED_MESSAGE, {
|
||||
author: stripObjectToScalars(msg.author),
|
||||
channel: stripObjectToScalars(targetChannel),
|
||||
author: userToConfigAccessibleUser(msg.author),
|
||||
channel: channelToConfigAccessibleChannel(targetChannel),
|
||||
datetime: postAt.format(timeAndDate.getDateFormat("pretty_datetime")),
|
||||
date: postAt.format(timeAndDate.getDateFormat("date")),
|
||||
time: postAt.format(timeAndDate.getDateFormat("time")),
|
||||
|
@ -184,8 +185,8 @@ export async function actualPostCmd(
|
|||
|
||||
if (opts.repeat) {
|
||||
pluginData.state.logs.log(LogType.REPEATED_MESSAGE, {
|
||||
author: stripObjectToScalars(msg.author),
|
||||
channel: stripObjectToScalars(targetChannel),
|
||||
author: userToConfigAccessibleUser(msg.author),
|
||||
channel: channelToConfigAccessibleChannel(targetChannel),
|
||||
datetime: postAt.format(timeAndDate.getDateFormat("pretty_datetime")),
|
||||
date: postAt.format(timeAndDate.getDateFormat("date")),
|
||||
time: postAt.format(timeAndDate.getDateFormat("time")),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue