5 Commits

Author SHA1 Message Date
b6fbed1c49 Update workflow registry path
All checks were successful
Build Heidi Docker image / build-docker (push) Successful in 8s
2023-11-26 00:41:53 +01:00
e430b99e35 Update workflow registry path
Some checks failed
Build Heidi Docker image / build-docker (push) Failing after 9s
2023-11-26 00:41:17 +01:00
626611f5a8 Update dockerfile for unbuffered print
All checks were successful
Build Heidi Docker image / build-docker (push) Successful in 7s
2023-11-26 00:39:46 +01:00
56b625b5b8 Set DOCKER using env
All checks were successful
Build Heidi Docker image / build-docker (push) Successful in 8s
2023-11-26 00:36:25 +01:00
e3e42dc235 Add kaptn sounds 2023-11-26 00:33:20 +01:00
8 changed files with 27 additions and 9 deletions

View File

@ -4,6 +4,7 @@ on:
push:
branches: [master]
paths:
- ".gitea/workflows/*"
- "Dockerfile"
- "*.py"
- "requirements.txt"
@ -17,10 +18,10 @@ jobs:
- name: Login to container registry
uses: docker/login-action@v3
with:
registry: gitea.local.chriphost.de
registry: gitea.vps.chriphost.de
username: ${{ secrets.CONTAINER_REGISTRY_USER }}
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
- name: Build Docker image
run: docker build . --file Dockerfile --tag gitea.local.chriphost.de/christoph/discord-heidi:latest
run: docker build . --file Dockerfile --tag gitea.vps.chriphost.de/christoph/discord-heidi:latest
- name: Push Docker image
run: docker push gitea.local.chriphost.de/christoph/discord-heidi:latest
run: docker push gitea.vps.chriphost.de/christoph/discord-heidi:latest

View File

@ -7,4 +7,4 @@ WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
CMD ["python3", "bot.py"]
CMD ["python3", "-u", "bot.py"]

12
bot.py
View File

@ -19,12 +19,13 @@ from typing import Dict, List, Optional, Union
from rich.traceback import install
install(show_locals=True)
load_dotenv()
# ================================================================================================ #
# ================================================================================================ #
# NOTE: Always set this correctly: #
DOCKER = False #
# NOTE: Always set this correctly:
DOCKER = os.getenv("DOCKER") == "True"
# ================================================================================================ #
# ================================================================================================ #
@ -37,7 +38,6 @@ DOCKER = False #
LINUS_GUILD = discord.Object(id=431154792308408340)
TEST_GUILD = discord.Object(id=821511861178204161)
CONFIGPATH = "/config" if DOCKER else "."
USERCONFIGNAME = "Heidi_User.conf"
@ -350,7 +350,9 @@ async def user_config(
client.user_config[config_key][member.name] = config_value
client.write_user_config()
await interaction.response.send_message(f"Ok, ich schreibe {member.name}={config_value} in mein fettes Gehirn!")
await interaction.response.send_message(
f"Ok, ich schreibe {member.name}={config_value} in mein fettes Gehirn!"
)
# Commands ---------------------------------------------------------------------------------------
@ -597,11 +599,11 @@ async def play_voice_line_for_member(
# Used to start the bot locally, for docker the variables have to be set when the container is run
load_dotenv()
TOKEN: str = os.getenv("DISCORD_TOKEN") or ""
# Start client if TOKEN valid
if TOKEN != "":
print(f"Running client with DOCKER={DOCKER}")
client.run(TOKEN, log_handler=handler)
else:
print("DISCORD_TOKEN not found, exiting...")

BIN
heidi-sounds/kaptn/Discord Call.mkv (Stored with Git LFS) Normal file

Binary file not shown.

BIN
heidi-sounds/kaptn/FBI open up.mkv (Stored with Git LFS) Normal file

Binary file not shown.

BIN
heidi-sounds/kaptn/Kleine Spende Bitte.mkv (Stored with Git LFS) Normal file

Binary file not shown.

BIN
heidi-sounds/kaptn/Meine Chicken Nuggets Verbrennen.mkv (Stored with Git LFS) Normal file

Binary file not shown.

BIN
heidi-sounds/kaptn/Nebenrisiken.mkv (Stored with Git LFS) Normal file

Binary file not shown.