allow running cleancmd on news and thread channels (#293)
This commit is contained in:
parent
2042459fd2
commit
1e7a35eb4d
1 changed files with 1 additions and 4 deletions
|
@ -1,7 +1,5 @@
|
||||||
import { Message, Snowflake, TextChannel, User } from "discord.js";
|
import { Message, Snowflake, TextChannel, User } from "discord.js";
|
||||||
import { GuildPluginData } from "knub";
|
import { GuildPluginData } from "knub";
|
||||||
import moment from "moment-timezone";
|
|
||||||
import { channelToTemplateSafeChannel, userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||||
import { LogType } from "../../../data/LogType";
|
import { LogType } from "../../../data/LogType";
|
||||||
|
@ -10,7 +8,6 @@ import { getBaseUrl, sendErrorMessage, sendSuccessMessage } from "../../../plugi
|
||||||
import { allowTimeout } from "../../../RegExpRunner";
|
import { allowTimeout } from "../../../RegExpRunner";
|
||||||
import { DAYS, getInviteCodesInString, noop, SECONDS } from "../../../utils";
|
import { DAYS, getInviteCodesInString, noop, SECONDS } from "../../../utils";
|
||||||
import { utilityCmd, UtilityPluginType } from "../types";
|
import { utilityCmd, UtilityPluginType } from "../types";
|
||||||
import { boolean, number } from "io-ts";
|
|
||||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||||
import { humanizeDurationShort } from "../../../humanizeDurationShort";
|
import { humanizeDurationShort } from "../../../humanizeDurationShort";
|
||||||
|
|
||||||
|
@ -84,7 +81,7 @@ export async function cleanCmd(pluginData: GuildPluginData<UtilityPluginType>, a
|
||||||
}
|
}
|
||||||
|
|
||||||
const targetChannel = args.channel ? pluginData.guild.channels.cache.get(args.channel as Snowflake) : msg.channel;
|
const targetChannel = args.channel ? pluginData.guild.channels.cache.get(args.channel as Snowflake) : msg.channel;
|
||||||
if (!targetChannel || !(targetChannel instanceof TextChannel)) {
|
if (!targetChannel?.isText()) {
|
||||||
sendErrorMessage(pluginData, msg.channel, `Invalid channel specified`);
|
sendErrorMessage(pluginData, msg.channel, `Invalid channel specified`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue