Author SHA1 Message Date
imcompiling b727a80e4f Fix smells in main.py.
build_develop / build (push) Successful in 26s
2025-03-18 10:11:52 -04:00
imcompiling 857b5f1669 Update module name in dockerfile. 2025-03-18 10:10:38 -04:00
imcompiling 34cd2f9975 Rename module and add init file to conform to ruff.
build_develop / build (push) Successful in 21s
2025-03-18 10:03:51 -04:00
imcompiling 6af2476339 Update settings to fix a smell. Add some spelling words.
build_develop / build (push) Successful in 22s
2025-03-18 09:50:49 -04:00
imcompiling 4a3f356b23 Update imports. 2025-03-18 09:50:36 -04:00
imcompiling 4fe2339ac1 Update launch command to launch in new location. 2025-03-18 09:49:01 -04:00
imcompiling 2069b2544f Remove old config file. Update docker file for directory change. 2025-03-18 09:37:33 -04:00
imcompiling 901bcf3c62 Move all files into off-cooldown-bot dir. 2025-03-18 09:15:22 -04:00
imcompiling 8e8f84a42e Add more to dockerignore.
build_latest / build (push) Successful in 25s
2025-03-18 08:21:14 -04:00
imcompiling cd241e6f5e Remove extra $ on accident.
build_latest / build (push) Successful in 22s
2025-03-17 21:49:13 -04:00
imcompiling 93d9b565c0 Also update in latest.
build_latest / build (push) Failing after 19s
2025-03-17 21:45:00 -04:00
imcompiling c816d3b5b8 Update docker login action.
build_latest / build (push) Failing after 16s
2025-03-17 21:44:05 -04:00
imcompiling 91900f2b00 Update docker file, add a docker ignore.
build_latest / build (push) Failing after 16s
2025-03-17 21:36:09 -04:00
20 changed files with 27 additions and 47 deletions
+4
View File
@@ -0,0 +1,4 @@
.*
Dockerfile
renovate.json
README.md
+1 -1
View File
@@ -19,7 +19,7 @@ jobs:
- name: Install Docker - name: Install Docker
uses: https://github.com/papodaca/install-docker-action@v1 uses: https://github.com/papodaca/install-docker-action@v1
- name: Log into container registry - name: Log into container registry
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
registry: gitea.cheezers.org registry: gitea.cheezers.org
username: imcompiling username: imcompiling
+2 -2
View File
@@ -17,11 +17,11 @@ jobs:
- name: Install Docker - name: Install Docker
uses: https://github.com/papodaca/install-docker-action@v1 uses: https://github.com/papodaca/install-docker-action@v1
- name: Log into container registry - name: Log into container registry
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
registry: gitea.cheezers.org registry: gitea.cheezers.org
username: imcompiling username: imcompiling
password: $${{ secrets.PASSWORD }} password: ${{ secrets.PASSWORD }}
- name: Build Docker Image - name: Build Docker Image
run: docker build -t gitea.cheezers.org/imcompiling/off-cooldown-bot:latest . run: docker build -t gitea.cheezers.org/imcompiling/off-cooldown-bot:latest .
- name: Push Docker Image - name: Push Docker Image
+5 -5
View File
@@ -5,11 +5,11 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "Python: Module", "name": "Python: Module",
"type": "debugpy", "type": "debugpy",
"request": "launch", "request": "launch",
"module": "main", "module": "off_cooldown_bot.main",
"justMyCode": true "justMyCode": true
} }
] ]
} }
+1 -4
View File
@@ -4,8 +4,5 @@
"reportArgumentType": "information", "reportArgumentType": "information",
"reportAttributeAccessIssue": "warning" "reportAttributeAccessIssue": "warning"
}, },
"cSpell.words": [ "cSpell.words": ["cakeday", "cakedays", "cooldown", "nextcord"]
"cakeday",
"cakedays"
]
} }
+4 -8
View File
@@ -3,14 +3,10 @@ FROM python:3.12.3-slim
# install uv # install uv
COPY --from=ghcr.io/astral-sh/uv:0.6.5 /uv /uvx /bin/ COPY --from=ghcr.io/astral-sh/uv:0.6.5 /uv /uvx /bin/
WORKDIR /home COPY . /off_cooldown_bot
COPY config.py config.py
COPY main.py main.py
COPY pyproject.toml pyproject.toml
COPY cogs cogs/
# Sync the project into a new environment, using the frozen lockfile
WORKDIR /off_cooldown_bot
RUN uv sync --frozen --no-dev RUN uv sync --frozen --no-dev
CMD ["uv", "run", "./main.py"] CMD ["uv", "run", "./off_cooldown_bot/main.py"]
-22
View File
@@ -1,22 +0,0 @@
"""
File contains classes defining the Hydra configuraton structure.
"""
from dataclasses import dataclass
@dataclass
class Params:
"""
Class defines the various configuration parameters.
"""
discord_token: str
@dataclass
class BotConfig:
"""
Class defines all configs required for Dakiny Bot.
"""
params: Params
+1
View File
@@ -0,0 +1 @@
"""Empty init file for off_cooldown_bot module."""
+4 -4
View File
@@ -8,8 +8,8 @@ import pathlib
import nextcord import nextcord
from nextcord.ext import commands from nextcord.ext import commands
from logger import ocd_logger from .logger import ocd_logger
from settings import settings from .settings import settings
nextcord_logger = logging.getLogger("nextcord") nextcord_logger = logging.getLogger("nextcord")
nextcord_logger.setLevel(logging.DEBUG) nextcord_logger.setLevel(logging.DEBUG)
@@ -30,7 +30,7 @@ def main() -> None:
intents.message_content = True intents.message_content = True
# To enable the guilds privileged intent: # To enable the guilds privileged intent:
# intents.guilds = True # intents.guilds = True # noqa: ERA001
# To enable the members privileged intent: # To enable the members privileged intent:
intents.members = True intents.members = True
@@ -47,7 +47,7 @@ def main() -> None:
if bot.user is None: if bot.user is None:
ocd_logger.critical("Discord connection failed.") ocd_logger.critical("Discord connection failed.")
return return
ocd_logger.info(f"{bot.user.name} has connected to Discord!") ocd_logger.info("%s has connected to Discord!", bot.user.name)
# Run Discord bot # Run Discord bot
bot.run(settings.params.discord_token) bot.run(settings.params.discord_token)
@@ -35,3 +35,7 @@ class Settings(YAMLWizard):
settings = Settings.from_yaml_file(CONFIG_LOCATION) settings = Settings.from_yaml_file(CONFIG_LOCATION)
# I'm not expecting a list to be returned.
if isinstance(settings, list):
settings = settings[0]