Compare commits
4 commits
6eeea1343f
...
485168d13f
Author | SHA1 | Date | |
---|---|---|---|
485168d13f | |||
b26dbb3484 | |||
3301ad8c59 | |||
1d2450683e |
3 changed files with 12 additions and 3 deletions
|
@ -3,13 +3,17 @@ import logging
|
||||||
import discord
|
import discord
|
||||||
|
|
||||||
from . import post, verein
|
from . import post, verein
|
||||||
|
from .config import CONFIG
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class LenaverseBot(discord.Client):
|
class LenaverseBot(discord.Client):
|
||||||
def __init__(self) -> None:
|
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)
|
self.tree = discord.app_commands.CommandTree(self)
|
||||||
commands = post.COMMANDS + verein.COMMANDS
|
commands = post.COMMANDS + verein.COMMANDS
|
||||||
|
@ -21,5 +25,9 @@ class LenaverseBot(discord.Client):
|
||||||
_logger.info("Commands synced")
|
_logger.info("Commands synced")
|
||||||
|
|
||||||
async def on_ready(self) -> None:
|
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!")
|
_logger.info(f"{self.user.name} has connected to Discord!")
|
||||||
|
|
|
@ -73,6 +73,7 @@ class Config(BaseModel):
|
||||||
discord_token: str
|
discord_token: str
|
||||||
command_prefix: str
|
command_prefix: str
|
||||||
command_failed: str
|
command_failed: str
|
||||||
|
status: str
|
||||||
|
|
||||||
post: Post
|
post: Post
|
||||||
ev_info: ClubInfo
|
ev_info: ClubInfo
|
||||||
|
|
|
@ -3,7 +3,7 @@ authors = ["Jörn-Michael Miehe <joern-michael.miehe@lenaisten.de>"]
|
||||||
description = ""
|
description = ""
|
||||||
name = "lenaverse_bot"
|
name = "lenaverse_bot"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
aiohttp = {extras = ["speedups"], version = "^3.9.0"}
|
aiohttp = {extras = ["speedups"], version = "^3.9.0"}
|
||||||
|
|
Loading…
Reference in a new issue