mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-25 10:25:01 +00:00
.resolve instead of .fetch
Co-authored-by: Almeida <almeidx@pm.me>
This commit is contained in:
parent
432e237a7b
commit
c38ef6f0a0
1 changed files with 2 additions and 2 deletions
|
@ -39,14 +39,14 @@ export const ChangePermsAction = automodAction({
|
||||||
);
|
);
|
||||||
const target = await renderTarget(actionConfig.target);
|
const target = await renderTarget(actionConfig.target);
|
||||||
const channelId = actionConfig.channel ? await renderChannel(actionConfig.channel) : null;
|
const channelId = actionConfig.channel ? await renderChannel(actionConfig.channel) : null;
|
||||||
const role = await pluginData.guild.roles.fetch(target);
|
const role = pluginData.guild.roles.resolve(target);
|
||||||
if (!role) {
|
if (!role) {
|
||||||
const member = await pluginData.guild.members.fetch(target).catch(noop);
|
const member = await pluginData.guild.members.fetch(target).catch(noop);
|
||||||
if (!member) return;
|
if (!member) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channelId && isValidSnowflake(channelId)) {
|
if (channelId && isValidSnowflake(channelId)) {
|
||||||
const channel = await pluginData.guild.channels.fetch(channelId);
|
const channel = pluginData.guild.channels.resolve(channelId);
|
||||||
if (!channel) return;
|
if (!channel) return;
|
||||||
const overwrite = channel.permissionOverwrites.cache.find((pw) => pw.id === target);
|
const overwrite = channel.permissionOverwrites.cache.find((pw) => pw.id === target);
|
||||||
const allow = new Permissions(overwrite?.allow ?? 0n).serialize();
|
const allow = new Permissions(overwrite?.allow ?? 0n).serialize();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue