diff --git a/lenaverse_bot/__init__.py b/lenaverse_bot/__init__.py new file mode 100644 index 0000000..47e8cfc --- /dev/null +++ b/lenaverse_bot/__init__.py @@ -0,0 +1,3 @@ +import discord + +discord.utils.setup_logging() diff --git a/lenaverse_bot/core/bot.py b/lenaverse_bot/core/bot.py new file mode 100644 index 0000000..3145a41 --- /dev/null +++ b/lenaverse_bot/core/bot.py @@ -0,0 +1,21 @@ +import logging + +import discord +from discord.ext import commands + +_logger = logging.getLogger(__name__) + + +class LenaverseBot(commands.Bot): + def __init__(self) -> None: + intents = discord.Intents.default() + intents.message_content = True + + super().__init__( + command_prefix="!", + intents=intents, + ) + + async def on_ready(self) -> None: + assert self.user is not None + _logger.info(f"{self.user.name} has connected to Discord!") diff --git a/lenaverse_bot/main.py b/lenaverse_bot/main.py index 002a34a..02523ce 100644 --- a/lenaverse_bot/main.py +++ b/lenaverse_bot/main.py @@ -1,5 +1,16 @@ +import os + +from .core.bot import LenaverseBot + + def main() -> None: - print("Hello World") + TOKEN = os.getenv("TTSBOT_TOKEN") or "" + + bot = LenaverseBot() + bot.run( + token=TOKEN, + log_handler=None, + ) if __name__ == "__main__":