3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 14:11:50 +00:00

fix channel.messages

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
metal 2023-03-12 00:50:30 +00:00 committed by GitHub
parent ddec78b929
commit 3903db7d10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
import { PermissionsBitField, Snowflake } from "discord.js"; import { ChannelType, PermissionsBitField, Snowflake } from "discord.js";
import { GuildPluginData } from "knub"; import { GuildPluginData } from "knub";
import moment from "moment-timezone"; import moment from "moment-timezone";
import { LogType } from "../../../data/LogType"; import { LogType } from "../../../data/LogType";
@ -17,7 +17,7 @@ export async function deleteNextItem(pluginData: GuildPluginData<AutoDeletePlugi
scheduleNextDeletion(pluginData); scheduleNextDeletion(pluginData);
const channel = pluginData.guild.channels.cache.get(itemToDelete.message.channel_id as Snowflake); const channel = pluginData.guild.channels.cache.get(itemToDelete.message.channel_id as Snowflake);
if (!channel) { if (!channel || channel.type === ChannelType.GuildCategory) {
// Channel was deleted, ignore // Channel was deleted, ignore
return; return;
} }