17 Commits
Author SHA1 Message Date
renovate-bot bb5889f7ae Update ghcr.io/astral-sh/uv Docker tag to v0.6.17
build_latest / build (push) Successful in 22s
2025-04-27 04:03:17 +00:00
renovate-bot 3c489c83e2 Update python Docker tag to v3.13.3 2025-04-13 14:14:54 +00:00
renovate-bot aeb00a107f Update ghcr.io/astral-sh/uv Docker tag to v0.6.14 2025-04-13 14:14:50 +00:00
renovate-bot c65acb094a Update ghcr.io/astral-sh/uv Docker tag to v0.6.12
build_latest / build (push) Successful in 22s
2025-04-06 04:03:39 +00:00
renovate-bot 631c42ac0b Update ghcr.io/astral-sh/uv Docker tag to v0.6.10
build_latest / build (push) Successful in 21s
2025-03-30 04:03:31 +00:00
imcompiling 7811abc33e Merge pull request 'Update actions/checkout action to v4' (#2) from renovate/actions-checkout-4.x into main
build_latest / build (push) Successful in 20s
Reviewed-on: #2
Reviewed-by: imcompiling <[email protected]>
2025-03-23 23:39:22 -04:00
imcompiling 2a01cf09ec Merge pull request 'Update python Docker tag to v3.13.2' (#1) from renovate/python-3.x into main
build_latest / build (push) Has been cancelled
Reviewed-on: #1
Reviewed-by: imcompiling <[email protected]>
2025-03-23 23:39:11 -04:00
renovate-bot 6d9325c354 Update actions/checkout action to v4 2025-03-23 04:03:22 +00:00
renovate-bot 865802eeeb Update python Docker tag to v3.13.2 2025-03-23 04:03:20 +00:00
renovate-bot 8fce10d9be Update ghcr.io/astral-sh/uv Docker tag to v0.6.9
build_latest / build (push) Successful in 22s
2025-03-23 04:03:16 +00:00
imcompiling 5c6fa4386e Correct database ignore.
build_latest / build (push) Successful in 17s
build_develop / build (push) Successful in 17s
2025-03-19 09:51:13 -04:00
imcompiling 590cb9abe4 Don't need to build latest in release workflow.
build_latest / build (push) Successful in 17s
2025-03-19 09:35:00 -04:00
imcompiling 46f518c1c4 Update uv command to not install dev dependencies and to use the already existing venv.
build_latest / build (push) Successful in 18s
2025-03-19 08:42:50 -04:00
imcompiling 30ecdab8a5 Ignore the database directory.
build_develop / build (push) Successful in 18s
build_latest / build (push) Successful in 17s
2025-03-18 22:44:21 -04:00
imcompiling 565ea73792 Convert to be more consistant like python package.
build_develop / build (push) Successful in 20s
2025-03-18 22:43:20 -04:00
imcompiling bfef75870f Change directory in dockerfile.
build_develop / build (push) Successful in 17s
2025-03-18 22:09:13 -04:00
imcompiling 56289e7038 Use home directory.
build_develop / build (push) Successful in 21s
2025-03-18 22:00:38 -04:00
12 changed files with 42 additions and 40 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Install Docker - name: Install Docker
+1 -1
View File
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Install Docker - name: Install Docker
+1 -3
View File
@@ -23,8 +23,6 @@ jobs:
- name: Set env - name: Set env
run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build Docker Images - name: Build Docker Images
run: docker build -t gitea.cheezers.org/imcompiling/off-cooldown-bot:latest -t gitea.cheezers.org/imcompiling/off-cooldown-bot:${{env.GIT_TAG}} . run: docker build -t gitea.cheezers.org/imcompiling/off-cooldown-bot:${{env.GIT_TAG}} .
- name: Push Latest Image
run: docker push gitea.cheezers.org/imcompiling/off-cooldown-bot:latest
- name: Push Tagged Image - name: Push Tagged Image
run: docker push gitea.cheezers.org/imcompiling/off-cooldown-bot:${{env.GIT_TAG}} run: docker push gitea.cheezers.org/imcompiling/off-cooldown-bot:${{env.GIT_TAG}}
+1 -1
View File
@@ -129,4 +129,4 @@ dmypy.json
nextcord.log nextcord.log
outputs/ outputs/
database.db /database
+1 -2
View File
@@ -8,9 +8,8 @@
"name": "Python: Module", "name": "Python: Module",
"type": "debugpy", "type": "debugpy",
"request": "launch", "request": "launch",
"module": "main", "module": "off_cooldown_bot",
"justMyCode": true, "justMyCode": true,
"cwd": "${workspaceFolder}/off_cooldown_bot"
} }
] ]
} }
+5 -5
View File
@@ -1,12 +1,12 @@
FROM python:3.12.3-slim FROM python:3.13.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.17 /uv /uvx /bin/
COPY . /off_cooldown_bot COPY . /home
# Sync the project into a new environment, using the frozen lockfile # Sync the project into a new environment, using the frozen lockfile
WORKDIR /off_cooldown_bot WORKDIR /home
RUN uv sync --frozen --no-dev RUN uv sync --frozen --no-dev
CMD ["uv", "run", "./off_cooldown_bot/main.py"] CMD ["uv", "run", "--frozen", "--no-dev", "-m", "off_cooldown_bot"]
+14
View File
@@ -0,0 +1,14 @@
"""Starts the app for off_cooldown_bot."""
import logging
from .app import run
nextcord_logger = logging.getLogger("nextcord")
nextcord_logger.setLevel(logging.DEBUG)
nextcord_handler = logging.FileHandler(filename="nextcord.log", encoding="utf-8", mode="w")
nextcord_handler.setFormatter(logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s"))
nextcord_logger.addHandler(nextcord_handler)
if __name__ == "__main__":
run()
@@ -2,24 +2,18 @@
from __future__ import annotations from __future__ import annotations
import logging
import pathlib import pathlib
import nextcord import nextcord
from logger import ocd_logger
from nextcord.ext import commands from nextcord.ext import commands
from settings import settings
nextcord_logger = logging.getLogger("nextcord") from .logger import ocd_logger
nextcord_logger.setLevel(logging.DEBUG) from .settings import settings
nextcord_handler = logging.FileHandler(filename="nextcord.log", encoding="utf-8", mode="w")
nextcord_handler.setFormatter(logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s"))
nextcord_logger.addHandler(nextcord_handler)
birthday_list: list[int] = [] birthday_list: list[int] = []
def main() -> None: def run() -> None:
"""Set config, intents, then connects the bot to discord.""" """Set config, intents, then connects the bot to discord."""
# Allows privileged intents for monitoring members joining, roles editing, and role assignments # Allows privileged intents for monitoring members joining, roles editing, and role assignments
# These need to be enabled in the developer portal as well # These need to be enabled in the developer portal as well
@@ -37,8 +31,8 @@ def main() -> None:
bot = commands.Bot(intents=intents) bot = commands.Bot(intents=intents)
# Get the modules of all cogs whose directory structure is ./cogs/<module_name> # Get the modules of all cogs whose directory structure is ./cogs/<module_name>
for folder in pathlib.Path("cogs").iterdir(): for folder in pathlib.Path("./off_cooldown_bot/cogs").iterdir():
bot.load_extension(f"cogs.{folder.name}") bot.load_extension(f"off_cooldown_bot.cogs.{folder.name}")
@bot.listen() @bot.listen()
async def on_ready() -> None: async def on_ready() -> None:
@@ -50,7 +44,3 @@ def main() -> None:
# Run Discord bot # Run Discord bot
bot.run(settings.params.discord_token) bot.run(settings.params.discord_token)
if __name__ == "__main__":
main()
+3 -3
View File
@@ -3,13 +3,13 @@
from datetime import datetime from datetime import datetime
import nextcord import nextcord
from main import birthday_list
from nextcord.ext import commands from nextcord.ext import commands
from pytz import UTC from pytz import UTC
from sqlmodel import Session, col, select from sqlmodel import Session, col, select
from database.db import engine from off_cooldown_bot.app import birthday_list
from database.models import UserBirthday from off_cooldown_bot.database.db import engine
from off_cooldown_bot.database.models import UserBirthday
class BirthdayCog(commands.Cog, name="Birthday Commands"): class BirthdayCog(commands.Cog, name="Birthday Commands"):
+5 -5
View File
@@ -3,17 +3,17 @@
from datetime import UTC, datetime, time from datetime import UTC, datetime, time
import nextcord import nextcord
from logger import ocd_logger
from main import birthday_list
from nextcord.ext import commands, tasks from nextcord.ext import commands, tasks
from pytz import timezone from pytz import timezone
from settings import settings
from sqlalchemy import select from sqlalchemy import select
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
from sqlmodel import col from sqlmodel import col
from database.db import engine from off_cooldown_bot.app import birthday_list
from database.models import UserBirthday from off_cooldown_bot.database.db import engine
from off_cooldown_bot.database.models import UserBirthday
from off_cooldown_bot.logger import ocd_logger
from off_cooldown_bot.settings import settings
class DailyLoop(commands.Cog, name="Daily Loop"): class DailyLoop(commands.Cog, name="Daily Loop"):
@@ -1,9 +1,10 @@
"""Defines cog for on message listener.""" """Defines cog for on message listener."""
import nextcord import nextcord
from main import birthday_list
from nextcord.ext import commands from nextcord.ext import commands
from off_cooldown_bot.app import birthday_list
class SubmissionListener(commands.Cog, name="Message Listener"): class SubmissionListener(commands.Cog, name="Message Listener"):
"""Sets up message listener.""" """Sets up message listener."""
+1 -1
View File
@@ -4,7 +4,7 @@ from sqlmodel import SQLModel, create_engine
from . import models # noqa: F401 - Need this import for creating the models. from . import models # noqa: F401 - Need this import for creating the models.
url = "sqlite:///database.db" url = "sqlite:///database/database.db"
engine = create_engine(url) engine = create_engine(url)
SQLModel.metadata.create_all(engine) SQLModel.metadata.create_all(engine)