-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: GitHub <[email protected]>
- Loading branch information
1 parent
099a38e
commit 555624a
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from discord import Embed | ||
from discord.ext.commands import Cog | ||
from pydis_core.utils import scheduling | ||
|
||
from bot.bot import Bot | ||
from bot.constants import Channels, DEBUG_MODE | ||
from bot.log import get_logger | ||
|
||
log = get_logger(__name__) | ||
|
||
|
||
class Logging(Cog): | ||
"""Debug logging module.""" | ||
|
||
def __init__(self, bot: Bot): | ||
self.bot = bot | ||
|
||
scheduling.create_task(self.startup_greeting()) | ||
|
||
async def startup_greeting(self) -> None: | ||
"""Announce our presence to the configured devlog channel.""" | ||
await self.bot.wait_until_guild_available() | ||
log.info("Bot connected!") | ||
|
||
embed = Embed(description="Connected!") | ||
embed.set_author( | ||
name="Anubis", | ||
url="https://github.com/letsbuilda/anubis", | ||
# icon_url=( | ||
# "https://raw.githubusercontent.com/" | ||
# "python-discord/branding/main/logos/logo_circle/logo_circle_large.png" | ||
# ) | ||
) | ||
|
||
if not DEBUG_MODE: | ||
await self.bot.get_channel(Channels.dev_log).send(embed=embed) | ||
|
||
|
||
async def setup(bot: Bot) -> None: | ||
"""Load the Logging cog.""" | ||
await bot.add_cog(Logging(bot)) |