Compare commits
No commits in common. "13dcddb135f740f04b95b3e69dc80b0575a9d8c8" and "59ce255fda2f5fbe76114b1c1f370c30afe2465c" have entirely different histories.
13dcddb135
...
59ce255fda
8 changed files with 2 additions and 60 deletions
|
@ -38,7 +38,6 @@ RUN set -ex; \
|
|||
export DEBIAN_FRONTEND=noninteractive; \
|
||||
apt-get update; apt-get install --yes --no-install-recommends \
|
||||
git-flow \
|
||||
git-lfs \
|
||||
; rm -rf /var/lib/apt/lists/*;
|
||||
|
||||
# [Optional] Uncomment this line to install global node packages.
|
||||
|
|
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -1 +0,0 @@
|
|||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
|
@ -4,7 +4,6 @@ import discord
|
|||
|
||||
from .commands import lsstuff
|
||||
from .post import ev_post
|
||||
from .verein import ev_join, ev_linktree
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -15,8 +14,6 @@ class LenaverseBot(discord.Client):
|
|||
|
||||
self.tree = discord.app_commands.CommandTree(self)
|
||||
self.tree.add_command(ev_post)
|
||||
self.tree.add_command(ev_join)
|
||||
self.tree.add_command(ev_linktree)
|
||||
self.tree.add_command(lsstuff)
|
||||
|
||||
async def setup_hook(self):
|
||||
|
|
|
@ -7,10 +7,8 @@ from pydantic import BaseModel
|
|||
|
||||
|
||||
class Post(BaseModel):
|
||||
# users authorized to posts
|
||||
users: list[int]
|
||||
# where to put posts
|
||||
channel: int
|
||||
users: list[int]
|
||||
|
||||
def get_channel(
|
||||
self,
|
||||
|
@ -26,16 +24,9 @@ class Post(BaseModel):
|
|||
return channel
|
||||
|
||||
|
||||
class ClubInfo(BaseModel):
|
||||
linktree: str = ""
|
||||
join_file: str = "Aufnahmeantrag.pdf"
|
||||
join_message: str = ""
|
||||
|
||||
|
||||
class Config(BaseModel):
|
||||
discord_token: str
|
||||
post: Post
|
||||
ev_info: ClubInfo
|
||||
|
||||
@classmethod
|
||||
def get(cls) -> Self:
|
||||
|
|
|
@ -106,7 +106,7 @@ async def ev_post(interaction: discord.Interaction) -> None:
|
|||
|
||||
else:
|
||||
# Zugriff verweigern
|
||||
_logger.info(
|
||||
_logger.warning(
|
||||
f"User {interaction.user.name}({interaction.user.id}) tried to /post"
|
||||
)
|
||||
await interaction.response.send_message(
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
import discord
|
||||
|
||||
from lenaverse_bot import __file__ as module_file
|
||||
|
||||
from .config import CONFIG
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def get_files_path() -> Path:
|
||||
module_path = Path(module_file)
|
||||
|
||||
if module_path.is_file():
|
||||
module_path = module_path.parent
|
||||
|
||||
result = module_path / "files"
|
||||
assert result.is_dir()
|
||||
|
||||
return result
|
||||
|
||||
|
||||
@discord.app_commands.command()
|
||||
async def ev_linktree(interaction: discord.Interaction) -> None:
|
||||
_logger.debug(f"User {interaction.user.name}({interaction.user.id}) used /linktree")
|
||||
await interaction.response.send_message(
|
||||
content=CONFIG.ev_info.linktree.strip(),
|
||||
suppress_embeds=True,
|
||||
)
|
||||
|
||||
|
||||
@discord.app_commands.command()
|
||||
async def ev_join(interaction: discord.Interaction) -> None:
|
||||
_logger.debug(f"User {interaction.user.name}({interaction.user.id}) used /join")
|
||||
await interaction.response.send_message(
|
||||
content=CONFIG.ev_info.join_message.strip(),
|
||||
file=discord.File(get_files_path() / CONFIG.ev_info.join_file),
|
||||
)
|
BIN
lenaverse_bot/files/Aufnahmeantrag.pdf
(Stored with Git LFS)
BIN
lenaverse_bot/files/Aufnahmeantrag.pdf
(Stored with Git LFS)
Binary file not shown.
|
@ -1,7 +1,6 @@
|
|||
[tool.poetry]
|
||||
authors = ["Jörn-Michael Miehe <joern-michael.miehe@lenaisten.de>"]
|
||||
description = ""
|
||||
include = ["lenaverse_bot/files/*"]
|
||||
name = "lenaverse_bot"
|
||||
readme = "README.md"
|
||||
version = "0.1.0"
|
||||
|
|
Loading…
Reference in a new issue