from discord.ext import commands
import discord
import time


class Automod(commands.Cog):
    def __init__(self, client):
        self._last_member = None
        self.client = client

    @commands.Cog.listener()
    async def on_member_join(self, member):
        lastmemjoin = open("lastmemsjoined", 'a')
        lastmemjoin.write(str(member) + "\n" + str(time.monotonic()))

    @commands.Cog.listener()
    async def on_message(self, message):

        await self.client.process_commands(message)


def setup(client):
    client.add_cog(Automod(client))
