mirror of
https://code.lenaisten.de/Lenaisten/lenaverse-bot.git
synced 2024-12-22 19:13:01 +00:00
add CONFIG.status
This commit is contained in:
parent
6eeea1343f
commit
1d2450683e
2 changed files with 11 additions and 2 deletions
|
@ -3,13 +3,17 @@ import logging
|
|||
import discord
|
||||
|
||||
from . import post, verein
|
||||
from .config import CONFIG
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class LenaverseBot(discord.Client):
|
||||
def __init__(self) -> None:
|
||||
super().__init__(intents=discord.Intents.default())
|
||||
super().__init__(
|
||||
intents=discord.Intents.default(),
|
||||
activity=discord.CustomActivity(name=CONFIG.status),
|
||||
)
|
||||
|
||||
self.tree = discord.app_commands.CommandTree(self)
|
||||
commands = post.COMMANDS + verein.COMMANDS
|
||||
|
@ -21,5 +25,9 @@ class LenaverseBot(discord.Client):
|
|||
_logger.info("Commands synced")
|
||||
|
||||
async def on_ready(self) -> None:
|
||||
assert self.user is not None
|
||||
await self.wait_until_ready()
|
||||
|
||||
if self.user is None:
|
||||
return None
|
||||
|
||||
_logger.info(f"{self.user.name} has connected to Discord!")
|
||||
|
|
|
@ -73,6 +73,7 @@ class Config(BaseModel):
|
|||
discord_token: str
|
||||
command_prefix: str
|
||||
command_failed: str
|
||||
status: str
|
||||
|
||||
post: Post
|
||||
ev_info: ClubInfo
|
||||
|
|
Loading…
Reference in a new issue