Quellcode durchsuchen

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 vor 5 Jahren
Ursprung
Commit
eacb545288
3 geänderte Dateien mit 15 neuen und 16 gelöschten Zeilen
  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 Datei anzeigen


+ 0
- 0
docs/requirements.txt Datei anzeigen


+ 15
- 16
roxbot/core.py Datei anzeigen

@@ -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 #
#############

Laden…
Abbrechen
Speichern