Browse Source

fixed bug where Core.json was not being made. Moved all of logging into the core class for reals.

tags/v2.0.0
Roxie Gibson 5 years ago
parent
commit
eacb545288
3 changed files with 15 additions and 16 deletions
  1. +0
    -0
      docs/installation/linux.md
  2. +0
    -0
      docs/requirements.txt
  3. +15
    -16
      roxbot/core.py

+ 0
- 0
docs/installation/linux.md View File


+ 0
- 0
docs/requirements.txt View File


+ 15
- 16
roxbot/core.py View File

@@ -125,10 +125,20 @@ class ErrorHandling:
await ctx.send(embed=embed)


class Logging:
"""Cog that deals with internal logging with Roxbot that is posted in Discord."""
class Core(ErrorHandling):
"""Core bot cog. Includes management commands, logging, error handling, and backups."""
def __init__(self, bot_client):
self.bot = bot_client
super().__init__(self.bot)

# Backup setup
if roxbot.backup_enabled:
self.backup_task = self.bot.loop.create_task(self.auto_backups())

# Logging Setup
self.bot.add_listener(self.cleanup_logging_settings, "on_guild_channel_delete")
self.bot.add_listener(self.log_member_join, "on_member_join")
self.bot.add_listener(self.log_member_remove, "on_member_remove")

self.settings = {
"logging": {
@@ -138,9 +148,9 @@ class Logging:
}
}

self.bot.add_listener(self.cleanup_logging_settings, "on_guild_channel_delete")
self.bot.add_listener(self.log_member_join, "on_member_join")
self.bot.add_listener(self.log_member_remove, "on_member_remove")
#############
# Logging #
#############

@staticmethod
async def cleanup_logging_settings(channel):
@@ -200,17 +210,6 @@ class Logging:
return await ctx.send("No valid option given.")
return settings.update(settings["logging"], "logging")


class Core(ErrorHandling, Logging):
"""Core bot cog. Includes management commands, logging, error handling, and backups."""
def __init__(self, bot_client):
self.bot = bot_client
super().__init__(self.bot)

# Backup setup
if roxbot.backup_enabled:
self.backup_task = self.bot.loop.create_task(self.auto_backups())

#############
# Backups #
#############

Loading…
Cancel
Save