import discord
from discord.ext import commands
import psutil
import os


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

    @commands.command()
    async def usage(self, ctx):
        """zie de usage van de bot"""
        process = psutil.Process(os.getpid())
        embed = discord.Embed(title='Jappenbot', color=0xFF69B4)
        embed.set_author(name=str(self.bot.user), icon_url=self.bot.user.avatar_url)
        embed.add_field(name='Library',value='Discord.py Rewrite', inline=True)
        embed.add_field(name='Version', value='Python 3.6.5', inline=True)
        embed.set_image(url=self.bot.user.avatar_url)
        embed.add_field(name='Memory Usage', value=str(round(process.memory_info()[0]/1000000,0)) + ' MB')
        embed.add_field(name='CPU Usage', value=str(process.cpu_percent(0.1)) + '%')
        embed.set_footer(text='Made by Wesley ウィアブ#8782, Flevosap#4970, Haan#0420')
        await ctx.send(embed=embed)


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