add pat command
@@ -288,6 +288,21 @@ class Fun(commands.Cog):
async def coin_flip(self, ctx):
await self.bot.send(ctx, random.choice(('heads', 'tails')))
+ @commands.command(name='pat')
+ async def pat(self, ctx, thing: typing.Union[discord.User, str]):
+ if isinstance(thing, discord.User):
+ thing = thing.mention
+ else:
+ thing = thing
+
+ resp = await self.ses.get('https://rra.ram.moe/i/r?type=pat')
+ image_url = 'https://rra.ram.moe' + (await resp.json())['path']
+
+ embed = discord.Embed(color=self.d.cc, title=f'{ctx.author.mention} pats {thing}')
+ embed.set_image(url=image_url)
+
+ await ctx.send(embed=embed)
+
def setup(bot):
bot.add_cog(Fun(bot))
