fix(slowmode): fix error if the slowmode channel isn't cached

This commit is contained in:
Dragory 2021-10-17 11:31:32 +03:00
parent 151a5df4af
commit 0f465ffa2b
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -13,7 +13,7 @@ export async function applyBotSlowmodeToUserId(
userId: string,
) {
// Deny sendMessage permission from the user. If there are existing permission overwrites, take those into account.
const existingOverride = channel.permissionOverwrites.resolve(userId as Snowflake);
const existingOverride = channel.permissionOverwrites?.resolve(userId as Snowflake);
try {
pluginData.state.serverLogs.ignoreLog(LogType.CHANNEL_UPDATE, channel.id, 5 * 1000);
if (existingOverride) {