import discord
from discord.ext import commands
import aiohttp


class Anime:
    def __init__(self, bot):
        self.bot = bot


    @commands.command()
    @commands.guild_only()
    async def knuffel(self, ctx, member: discord.Member):
        """geef iemand een knuffel"""
        async with aiohttp.ClientSession() as sess:
            async with sess.get('https://nekos.life/api/v2/img/hug') as resp:
                data = await resp.json()
                embed = discord.Embed(title=f'{ctx.message.author} knuffelt je {member.name}!', color=0xFF69B4)
                embed.set_image(url=data['url'])
                await ctx.send(embed=embed)


    @commands.command()
    @commands.guild_only()
    async def kus(self, ctx, member: discord.Member):
        """geef iemand een kus"""
        async with aiohttp.ClientSession() as sess:
            async with sess.get('https://nekos.life/api/v2/img/kiss') as resp:
                data = await resp.json()
                embed = discord.Embed(title=f'{ctx.message.author} kust je {member.name}!', color=0xFF69B4)
                embed.set_image(url=data['url'])
                await ctx.send(embed=embed)


    @commands.command()
    @commands.guild_only()
    async def klopje(self, ctx, member: discord.Member):
        """geef iemand een hoofdklopje"""
        async with aiohttp.ClientSession() as sess:
            async with sess.get('https://nekos.life/api/v2/img/pat') as resp:
                data = await resp.json()
                embed = discord.Embed(title=f'{ctx.message.author} geeft je een hoofdklopje {member.name}!', color=0xFF69B4)
                embed.set_image(url=data['url'])
                await ctx.send(embed=embed)


    @commands.command()
    @commands.guild_only()
    async def sla(self, ctx, member: discord.Member):
        """sla iemand"""
        async with aiohttp.ClientSession() as sess:
            async with sess.get('https://nekos.life/api/v2/img/slap') as resp:
                data = await resp.json()
                embed = discord.Embed(title=f'{ctx.message.author} slaat je {member.name}!', color=0xFF69B4)
                embed.set_image(url=data['url'])
                await ctx.send(embed=embed)


    @commands.command()
    @commands.guild_only()
    async def kietel(self, ctx, member: discord.Member):
        """kietel iemand"""
        async with aiohttp.ClientSession() as sess:
            async with sess.get('https://nekos.life/api/v2/img/tickle') as resp:
                data = await resp.json()
                embed = discord.Embed(title=f'{ctx.message.author} kietelt je {member.name}!', color=0xFF69B4)
                embed.set_image(url=data['url'])
                await ctx.send(embed=embed)


def setup(bot):
    bot.add_cog(Anime(bot))
