Compare commits
6 Commits
e94fbdd716
...
v3.0
| Author | SHA1 | Date | |
|---|---|---|---|
| b6fbed1c49 | |||
| e430b99e35 | |||
| 626611f5a8 | |||
| 56b625b5b8 | |||
| e3e42dc235 | |||
| 1c8a6c3945 |
@ -4,6 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [master]
|
||||||
paths:
|
paths:
|
||||||
|
- ".gitea/workflows/*"
|
||||||
- "Dockerfile"
|
- "Dockerfile"
|
||||||
- "*.py"
|
- "*.py"
|
||||||
- "requirements.txt"
|
- "requirements.txt"
|
||||||
@ -17,10 +18,10 @@ jobs:
|
|||||||
- name: Login to container registry
|
- name: Login to container registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: gitea.local.chriphost.de
|
registry: gitea.vps.chriphost.de
|
||||||
username: ${{ secrets.CONTAINER_REGISTRY_USER }}
|
username: ${{ secrets.CONTAINER_REGISTRY_USER }}
|
||||||
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
|
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
|
||||||
- name: Build Docker image
|
- 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
|
- 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
|
COPY requirements.txt requirements.txt
|
||||||
RUN pip3 install -r requirements.txt
|
RUN pip3 install -r requirements.txt
|
||||||
COPY . .
|
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
|
from rich.traceback import install
|
||||||
|
|
||||||
install(show_locals=True)
|
install(show_locals=True)
|
||||||
|
load_dotenv()
|
||||||
|
|
||||||
|
|
||||||
# ================================================================================================ #
|
# ================================================================================================ #
|
||||||
# ================================================================================================ #
|
# ================================================================================================ #
|
||||||
# NOTE: Always set this correctly: #
|
# NOTE: Always set this correctly:
|
||||||
DOCKER = False #
|
DOCKER = os.getenv("DOCKER") == "True"
|
||||||
# ================================================================================================ #
|
# ================================================================================================ #
|
||||||
# ================================================================================================ #
|
# ================================================================================================ #
|
||||||
|
|
||||||
@ -37,7 +38,6 @@ DOCKER = False #
|
|||||||
LINUS_GUILD = discord.Object(id=431154792308408340)
|
LINUS_GUILD = discord.Object(id=431154792308408340)
|
||||||
TEST_GUILD = discord.Object(id=821511861178204161)
|
TEST_GUILD = discord.Object(id=821511861178204161)
|
||||||
|
|
||||||
|
|
||||||
CONFIGPATH = "/config" if DOCKER else "."
|
CONFIGPATH = "/config" if DOCKER else "."
|
||||||
USERCONFIGNAME = "Heidi_User.conf"
|
USERCONFIGNAME = "Heidi_User.conf"
|
||||||
|
|
||||||
@ -350,6 +350,10 @@ async def user_config(
|
|||||||
client.user_config[config_key][member.name] = config_value
|
client.user_config[config_key][member.name] = config_value
|
||||||
client.write_user_config()
|
client.write_user_config()
|
||||||
|
|
||||||
|
await interaction.response.send_message(
|
||||||
|
f"Ok, ich schreibe {member.name}={config_value} in mein fettes Gehirn!"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Commands ---------------------------------------------------------------------------------------
|
# Commands ---------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -595,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
|
# 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 ""
|
TOKEN: str = os.getenv("DISCORD_TOKEN") or ""
|
||||||
|
|
||||||
# Start client if TOKEN valid
|
# Start client if TOKEN valid
|
||||||
if TOKEN != "":
|
if TOKEN != "":
|
||||||
|
print(f"Running client with DOCKER={DOCKER}")
|
||||||
client.run(TOKEN, log_handler=handler)
|
client.run(TOKEN, log_handler=handler)
|
||||||
else:
|
else:
|
||||||
print("DISCORD_TOKEN not found, exiting...")
|
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