Compare commits
5 Commits
1c8a6c3945
...
v3.0
| Author | SHA1 | Date | |
|---|---|---|---|
| b6fbed1c49 | |||
| e430b99e35 | |||
| 626611f5a8 | |||
| 56b625b5b8 | |||
| e3e42dc235 |
@ -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
|
||||
|
||||
@ -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
12
bot.py
@ -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
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
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
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
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
BIN
heidi-sounds/kaptn/Nebenrisiken.mkv
(Stored with Git LFS)
Normal file
Binary file not shown.
Reference in New Issue
Block a user