summaryrefslogtreecommitdiff
path: root/cogs/pfp.py
diff options
context:
space:
mode:
authorlexicade <jasonnlelong@gmail.com>2023-01-27 21:06:30 +0000
committerlexicade <jasonnlelong@gmail.com>2023-01-27 21:06:30 +0000
commit52801b4de1d63cd01191acf7fcee137977140ec0 (patch)
tree08271a1f1e3e8060486b6651c67c9934867c648e /cogs/pfp.py
parent8df873808c86805624851356f5dea76ec621de23 (diff)
Project initHEADmain
Diffstat (limited to 'cogs/pfp.py')
-rw-r--r--cogs/pfp.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/cogs/pfp.py b/cogs/pfp.py
new file mode 100644
index 0000000..6ce94f2
--- /dev/null
+++ b/cogs/pfp.py
@@ -0,0 +1,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]")