Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions fred/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

logging.root = logging.getLogger("FRED")
logging.basicConfig(level=getenv("FRED_LOG_LEVEL", logging.DEBUG))

from .fred import __version__ # noqa
logging.info("Init fred")

ENVVARS = (
"FRED_IP",
Expand Down
4 changes: 3 additions & 1 deletion fred/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import asyncio
from os import getenv

from .fred import Bot, nextcord
import nextcord

from fred.bot import Bot


async def a_main():
Expand Down
20 changes: 9 additions & 11 deletions fred/fred.py → fred/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
import sqlobject as sql
from nextcord.ext import commands

from . import config
from .cogs import crashes, mediaonly, webhooklistener, welcome, levelling
from .fred_commands import Commands, FredHelpEmbed
from .libraries import createembed, common

__version__ = version("fred")
from fred import config
from fred.cogs import crashes, mediaonly, webhooklistener, welcome, levelling
from fred.fred_commands import Commands, FredHelpEmbed
from fred.libraries import createembed, common, owo


class Bot(commands.Bot):
Expand All @@ -44,7 +42,7 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.isReady = False
self.logger = common.new_logger(self.__class__.__name__)
self.version = __version__
self.version = version("fred")
self.logger.info(f"Starting Fred v{self.version}")
self.setup_DB()
self.command_prefix = config.Misc.fetch("prefix")
Expand Down Expand Up @@ -168,11 +166,11 @@ async def send_DM(
) -> bool:
if self.owo:
if content is not None:
content = common.owoize(content)
content = owo.owoize(content)

if embed is not None:
embed.title = common.owoize(embed.title)
embed.description = common.owoize(embed.description)
embed.title = owo.owoize(embed.title)
embed.description = owo.owoize(embed.description)
# don't do the fields because those are most often literal command names, like in help

self.logger.info("Sending a DM", extra=common.user_info(user))
Expand Down Expand Up @@ -227,7 +225,7 @@ async def reply_to_msg(
reference = message

if self.owo and content is not None:
content = common.owoize(content)
content = owo.owoize(content)
if isinstance(reference, nextcord.MessageReference):
reference.fail_if_not_exists = False

Expand Down
3 changes: 3 additions & 0 deletions fred/cogs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import logging

logging.info("Init cogs")
Loading