Author SHA1 Message Date
imcompiling e9c8336124 Add module that will support open raid. Add test command.
build_develop / build (push) Successful in 21s
2025-03-19 11:39:26 -04:00
imcompiling ef92902932 Add utils to define guild ids that will use this bot. 2025-03-19 11:39:08 -04: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
7 changed files with 99 additions and 7 deletions
+1 -3
View File
@@ -23,8 +23,6 @@ jobs:
- name: Set env
run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- 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}} .
- name: Push Latest Image
run: docker push gitea.cheezers.org/imcompiling/off-cooldown-bot:latest
run: docker build -t gitea.cheezers.org/imcompiling/off-cooldown-bot:${{env.GIT_TAG}} .
- name: Push Tagged Image
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
outputs/
database
/database
+1 -1
View File
@@ -9,4 +9,4 @@ COPY . /home
WORKDIR /home
RUN uv sync --frozen --no-dev
CMD ["uv", "run", "python", "-m", "off_cooldown_bot"]
CMD ["uv", "run", "--frozen", "--no-dev", "-m", "off_cooldown_bot"]
+2 -1
View File
@@ -10,12 +10,13 @@ from sqlmodel import Session, col, select
from off_cooldown_bot.app import birthday_list
from off_cooldown_bot.database.db import engine
from off_cooldown_bot.database.models import UserBirthday
from off_cooldown_bot.utils import GUILDS
class BirthdayCog(commands.Cog, name="Birthday Commands"):
"""Class holds birthday commands."""
@nextcord.slash_command(guild_ids=[1000247361639030804, 822199658306076672])
@nextcord.slash_command(guild_ids=GUILDS)
async def birthday(self, interaction: nextcord.Interaction) -> None:
"""Parent slash command for birthday. Never called."""
+41
View File
@@ -0,0 +1,41 @@
"""Commands for testing."""
import nextcord
from nextcord.ext import application_checks, commands
from off_cooldown_bot.open_raid import OpenRaid
from off_cooldown_bot.utils import GUILDS
ME = 206602713511886849
def is_me(): # noqa: ANN201
"""Predicate that makes sure only I can run the test commands."""
def predicate(interaction: nextcord.Interaction) -> bool:
return interaction.user.id == ME
return application_checks.check(predicate)
class TestCog(commands.Cog, name="Test commands."):
"""Class holds commands for testing."""
def __init__(self, bot: commands.Bot) -> None:
self.bot: commands.Bot = bot
@nextcord.slash_command(guild_ids=GUILDS)
async def test(self, interaction: nextcord.Interaction) -> None:
"""Parent slash command for help. Never called."""
@test.subcommand()
@is_me()
async def election_start(self, interaction: nextcord.Interaction) -> None:
"""
Force starts election.
Args:
interaction (nextcord.Interaction): Interaction with the message.
"""
await interaction.response.send_message("Starting an open raid.", view=OpenRaid())
+49
View File
@@ -0,0 +1,49 @@
"""Contains functions for open raid sign-ups."""
import nextcord
class OpenRaid(nextcord.ui.View):
"""Class defines view for buttons on an open raid schedule message."""
def __init__(self) -> None:
super().__init__(timeout=None, auto_defer=True)
@nextcord.ui.button(label="Tank", style=nextcord.ButtonStyle.blurple)
async def tank(self, button: nextcord.ui.Button, interaction: nextcord.Interaction) -> None:
"""
Signs a user up as a tank.
Removes them if they are already signed up.
Args:
button (nextcord.ui.Button): Unneeded.
interaction (nextcord.Interaction): Interaction with command.
"""
@nextcord.ui.button(label="Healer", style=nextcord.ButtonStyle.green)
async def healer(self, button: nextcord.ui.Button, interaction: nextcord.Interaction) -> None:
"""
Signs a user up as a healer.
Removes them if they are already signed up.
Args:
button (nextcord.ui.Button): Unneeded.
interaction (nextcord.Interaction): Interaction with command.
"""
@nextcord.ui.button(label="DPS", style=nextcord.ButtonStyle.red)
async def dps(self, button: nextcord.ui.Button, interaction: nextcord.Interaction) -> None:
"""
Signs a user up as dps.
Removes them if they are already signed up.
Args:
button (nextcord.ui.Button): Unneeded.
interaction (nextcord.Interaction): Interaction with command.
"""
+3
View File
@@ -0,0 +1,3 @@
"""File contains functions and variables used widely."""
GUILDS = [1000247361639030804, 822199658306076672]