diff options
-rwxr-xr-x | bot.py | 16 | ||||
-rwxr-xr-x | cogs/admin.py | 12 |
2 files changed, 14 insertions, 14 deletions
@@ -54,11 +54,23 @@ class BedrockBot(commands.Bot): return await self.process_commands(message) - command = message.content.split()[0] + try: + command = message.content.split()[0] + except IndexError: + pass if command in self.custom_commands: await message.channel.send(self.custom_commands[command]) return + + async def on_message_delete(self, message): + channel = self.get_channel(718187032869994686) + embed = discord.Embed( + description=message.content, + color=message.author.color, + timestamp=message.created_at + ) + await channel.send(embed=embed) def run(self): - super().run(config.token, reconnect=True)
\ No newline at end of file + super().run(config.token, reconnect=True) diff --git a/cogs/admin.py b/cogs/admin.py index a432580..917a8de 100755 --- a/cogs/admin.py +++ b/cogs/admin.py @@ -12,18 +12,6 @@ class Admin(commands.Cog): async def is_mod(ctx): return ctx.author.guild_permissions.manage_channels - - @commands.Cog.listener() - async def on_deleted_message(self, message): - channel = self.bot.get_channel(718187032869994686) - #embed = discord.Embed( - # title = f'Deleted Message by {message.author}', - # description = message.content, - # color = message.author.color, - # timestamp = message.created_at - #) - #await channel.send(embed=embed) - await ctx.channel.send(message.content) @commands.command(aliases=['deleteEverything'], hidden=True) @commands.check(is_mod) |