discord.py 2.0 fun

Invites will not work because discord-ext-menus needs to be updated in Red
This commit is contained in:
aikaterna
2022-02-18 18:03:37 -08:00
parent 3d54796b69
commit 57ae7a52cd
7 changed files with 102 additions and 78 deletions

View File

@@ -42,7 +42,7 @@ class Invites(commands.Cog):
@invites.command()
async def show(self, ctx: commands.Context, invite_code_or_url: str = None):
"""Show the stats for an invite, or show all invites."""
if not ctx.me.permissions_in(ctx.channel).administrator:
if not ctx.channel.permissions_for(ctx.guild.me).administrator:
return await self._send_embed(ctx, PERM_MSG)
if not invite_code_or_url:
@@ -57,7 +57,7 @@ class Invites(commands.Cog):
@invites.command()
async def leaderboard(self, ctx: commands.Context, list_all_invites: bool = False):
"""List pinned invites or all invites in a leaderboard style."""
if not ctx.me.permissions_in(ctx.channel).administrator:
if not ctx.channel.permissions_for(ctx.guild.me).administrator:
return await self._send_embed(ctx, PERM_MSG)
if not list_all_invites:
@@ -96,7 +96,7 @@ class Invites(commands.Cog):
@invites.command()
async def pin(self, ctx: commands.Context, invite_code_or_url: str):
"""Pin an invite to the leaderboard."""
if not ctx.me.permissions_in(ctx.channel).administrator:
if not ctx.channel.permissions_for(ctx.guild.me).administrator:
return await self._send_embed(ctx, PERM_MSG)
invite_code = await self._find_invite_code(invite_code_or_url)