diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-05-24 18:29:57 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-05-24 18:29:57 -0400 |
commit | 9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c (patch) | |
tree | 4b95a06ff6991207ab8b8e93f0bca26e24a97f80 /src/lib/extensions/discord.js/BushGuild.ts | |
parent | 6b8115ab1ec94d4330019fc7a93e094d9d64c48e (diff) | |
download | tanzanite-9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c.tar.gz tanzanite-9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c.tar.bz2 tanzanite-9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c.zip |
fix: breaking changes
Diffstat (limited to 'src/lib/extensions/discord.js/BushGuild.ts')
-rw-r--r-- | src/lib/extensions/discord.js/BushGuild.ts | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/lib/extensions/discord.js/BushGuild.ts b/src/lib/extensions/discord.js/BushGuild.ts index 8b1b5fa..80755bc 100644 --- a/src/lib/extensions/discord.js/BushGuild.ts +++ b/src/lib/extensions/discord.js/BushGuild.ts @@ -1,15 +1,15 @@ import { AllowedMentions, banResponse, + BushGuildChannelManager, + BushGuildMemberManager, BushMessage, dmResponse, permissionsResponse, punishmentEntryRemove, type BanResponse, type BushClient, - type BushGuildChannelManager, type BushGuildMember, - type BushGuildMemberManager, type BushGuildMemberResolvable, type BushNewsChannel, type BushTextChannel, @@ -151,7 +151,7 @@ export class BushGuild extends Guild { if (!logChannel || !logChannel.isTextBased()) return; if ( !logChannel - .permissionsFor(this.me!.id) + .permissionsFor(this.members.me!.id) ?.has([PermissionFlagsBits.ViewChannel, PermissionFlagsBits.SendMessages, PermissionFlagsBits.EmbedLinks]) ) return; @@ -176,7 +176,7 @@ export class BushGuild extends Guild { */ public async bushBan(options: GuildBushBanOptions): Promise<BanResponse> { // checks - if (!this.me!.permissions.has(PermissionFlagsBits.BanMembers)) return banResponse.MISSING_PERMISSIONS; + if (!this.members.me!.permissions.has(PermissionFlagsBits.BanMembers)) return banResponse.MISSING_PERMISSIONS; let caseID: string | undefined = undefined; let dmSuccessEvent: boolean | undefined = undefined; @@ -319,7 +319,7 @@ export class BushGuild extends Guild { */ public async bushUnban(options: GuildBushUnbanOptions): Promise<UnbanResponse> { // checks - if (!this.me!.permissions.has(PermissionFlagsBits.BanMembers)) return unbanResponse.MISSING_PERMISSIONS; + if (!this.members.me!.permissions.has(PermissionFlagsBits.BanMembers)) return unbanResponse.MISSING_PERMISSIONS; let caseID: string | undefined = undefined; let dmSuccessEvent: boolean | undefined = undefined; @@ -413,7 +413,7 @@ export class BushGuild extends Guild { success.set(channel.id, false); continue; } - if (!channel.permissionsFor(this.me!.id)?.has([PermissionFlagsBits.ManageChannels])) { + if (!channel.permissionsFor(this.members.me!.id)?.has([PermissionFlagsBits.ManageChannels])) { errors.set(channel.id, new Error('client no permission')); success.set(channel.id, false); continue; @@ -442,7 +442,7 @@ export class BushGuild extends Guild { success.set(channel.id, false); } else { success.set(channel.id, true); - await permissionOverwrites.edit(this.me!, permsForMe, { reason }); + await permissionOverwrites.edit(this.members.me!, permsForMe, { reason }); await channel.send({ embeds: [ { @@ -466,8 +466,8 @@ export class BushGuild extends Guild { } public async quote(rawQuote: APIMessage, channel: BushTextChannel | BushNewsChannel | BushThreadChannel) { - if (!channel.isTextBased() || channel.isDMBased() || channel.guildId !== this.id || !this.me) return null; - if (!channel.permissionsFor(this.me).has('ManageWebhooks')) return null; + if (!channel.isTextBased() || channel.isDMBased() || channel.guildId !== this.id || !this.members.me) return null; + if (!channel.permissionsFor(this.members.me).has('ManageWebhooks')) return null; const quote = new BushMessage(client, rawQuote); @@ -643,10 +643,6 @@ export class BushGuild extends Guild { } } -export interface BushGuild extends Guild { - get me(): BushGuildMember | null; -} - /** * Options for unbanning a user */ |