Simplify fetching client member
This commit is contained in:
parent
f4b7685f94
commit
1c6c79dacf
@ -15,7 +15,7 @@ export async function getGuildChannel(guildID: string, channelID: string): Promi
|
||||
|
||||
export async function getChannelPermission(channel: GuildTextBasedChannel): Promise<Readonly<PermissionsBitField> | null> {
|
||||
try {
|
||||
const guildMember = await channel.guild.members.fetch(client.user!.id);
|
||||
const guildMember = await channel.guild.members.fetchMe();
|
||||
if (!guildMember) return null;
|
||||
|
||||
return channel.permissionsFor(guildMember);
|
||||
|
Loading…
Reference in New Issue
Block a user