Skip to content

Commit

Permalink
Add startup notification
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
shenanigansd authored Apr 15, 2024
1 parent 099a38e commit 555624a
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/bot/exts/core/logging.py
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))

0 comments on commit 555624a

Please sign in to comment.