import nextcord from nextcord.ext import commands from userinfo import parsedinfo class Logger(commands.Cog): def __init__(self, bot): self.mod = None self.client = bot @commands.Cog.listener() async def on_message_delete(self, ctx: nextcord.Message): embedlist = [nextcord.Embed( title="Message delete", description=ctx.content, url="https://git.squog.ru/entar/SquogBot" )] embedlist[0].set_author(name=ctx.author.name, icon_url=ctx.author.avatar.url) for image in ctx.attachments: newembed = nextcord.Embed(url="https://entarapi.xyz") newembed.set_image(image.url) # Unfortunately i cant add multiple images. embedlist.append(newembed) guild = await parsedinfo.find("guild", "id", ctx.guild.id) if guild and guild["log-channel"] != 0: channel = ctx.guild.get_channel(guild["log-channel"]) await channel.send(embeds=embedlist) @commands.Cog.listener() async def on_command(self, ctx: commands.Context): embed = nextcord.Embed( title="Command used", description=ctx.message.content ) embed.set_author(name=ctx.author.name, icon_url=ctx.author.avatar.url) embed.add_field(name="Channel", value=ctx.channel.name) guild = await parsedinfo.find("guild", "id", ctx.guild.id) if guild and guild["log-channel"] != 0: channel = ctx.guild.get_channel(guild["log-channel"]) await channel.send(embed=embed) @commands.Cog.listener() async def on_ready(self): print("Bot logged") # self.mod = self.client.get_channel(1356577069068324986) def setup(bot): bot.add_cog(Logger(bot))