mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
fix(slowmode): fix error if channel.permissionOverwrites doesn't exist
This commit is contained in:
parent
d27f6f94df
commit
0de271994f
1 changed files with 1 additions and 1 deletions
|
@ -19,7 +19,7 @@ export async function applyBotSlowmodeToUserId(
|
|||
if (existingOverride) {
|
||||
await existingOverride.edit({ SEND_MESSAGES: false });
|
||||
} else {
|
||||
await channel.permissionOverwrites.create(userId as Snowflake, { SEND_MESSAGES: false }, { type: 1 });
|
||||
await channel.permissionOverwrites?.create(userId as Snowflake, { SEND_MESSAGES: false }, { type: 1 });
|
||||
}
|
||||
} catch (e) {
|
||||
const user = await pluginData.client.users.fetch(userId as Snowflake).catch(() => new UnknownUser({ id: userId }));
|
||||
|
|
Loading…
Add table
Reference in a new issue