summaryrefslogtreecommitdiff
path: root/cogs/pfp.py
blob: 6ce94f2314a7f862db028563afbf37d7dba6118c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from discord.ext import commands
import discord
import importlib
import utils
importlib.reload(utils)


class PFP(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        global extension_name
        extension_name = "[PFP] "

    @commands.defer(ephemeral=False)
    @commands.command(
        aliases=[],
        application_command_meta=commands.ApplicationCommandMeta(
            options=[
                discord.ApplicationCommandOption(
                    name="user",
                    description="Post the users profile picture to chat.",
                    type=discord.ApplicationCommandOptionType.user,
                    required=True,
                ),
            ]
        )
    )
    async def pfp(self, ctx, user: discord.Member):
        """Post the users profile picture to chat."""
        await ctx.send(content=user.avatar.with_format('jpg'))


def setup(bot):
    print("INFO: Loading [PFP]... ", end="")
    bot.add_cog(PFP(bot))
    print("Done!")


def teardown(bot):
    print("INFO: Unloading [PFP]")