mirror of
https://code.lenaisten.de/Lenaisten/lenaverse-bot.git
synced 2024-11-21 22:43:01 +00:00
empty discord bot
This commit is contained in:
parent
876cd4ab53
commit
5a630aff26
3 changed files with 36 additions and 1 deletions
3
lenaverse_bot/__init__.py
Normal file
3
lenaverse_bot/__init__.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
import discord
|
||||
|
||||
discord.utils.setup_logging()
|
21
lenaverse_bot/core/bot.py
Normal file
21
lenaverse_bot/core/bot.py
Normal file
|
@ -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!")
|
|
@ -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__":
|
||||
|
|
Loading…
Reference in a new issue