Compare commits

...
9 Commits
Author SHA1 Message Date
imcompiling f735e6d846 Merge branch '70-sqlmodel'
build_develop / build (push) Successful in 34s
build_release / build (push) Successful in 22s
2025-03-14 16:43:28 -04:00
imcompiling 9fbaf7bcf6 Merge branch 'main' of https://gitea.cheezers.org/imcompiling/agon
build_develop / build (push) Has been cancelled
2025-03-14 16:42:48 -04:00
imcompiling c25d354fc0 Correct some parameter usage, handle errors if searches return nothing. 2025-03-14 16:09:52 -04:00
imcompiling e5d90a71d9 Correct parameter usage. 2025-03-14 16:02:18 -04:00
imcompiling 74ce22dd26 Was saving the message id to the wrong spot. 2025-03-13 00:39:47 -04:00
imcompiling f52b2fe49f Merge pull request 'Update ghcr.io/astral-sh/uv Docker tag to v0.6.5' (#81) from renovate/ghcr.io-astral-sh-uv-0.x into main
build_develop / build (push) Successful in 48s
Reviewed-on: #81
Reviewed-by: imcompiling <[email protected]>
2025-03-10 08:40:41 -04:00
renovate-bot 24a9fa998a Update ghcr.io/astral-sh/uv Docker tag to v0.6.5 2025-03-09 05:01:04 +00:00
imcompiling 63db4c1dd2 Merge pull request 'Update ghcr.io/astral-sh/uv Docker tag to v0.6.3' (#79) from renovate/ghcr.io-astral-sh-uv-0.x into main
build_develop / build (push) Successful in 51s
Reviewed-on: #79
Reviewed-by: imcompiling <[email protected]>
2025-03-03 23:03:42 -05:00
renovate-bot 8604ba2547 Update ghcr.io/astral-sh/uv Docker tag to v0.6.3 2025-03-02 05:01:27 +00:00
4 changed files with 26 additions and 14 deletions
+2 -2
View File
@@ -10,8 +10,8 @@
"ondelete" "ondelete"
], ],
"python.analysis.diagnosticSeverityOverrides": { "python.analysis.diagnosticSeverityOverrides": {
"reportOptionalMemberAccess": false, "reportOptionalMemberAccess": "warning",
"reportArgumentType": "information", "reportArgumentType": "information",
"reportAttributeAccessIssue": "warning" "reportAttributeAccessIssue": "warning"
} }
} }
+1 -1
View File
@@ -1,7 +1,7 @@
FROM python:3.12.3-slim FROM python:3.12.3-slim
# install uv # install uv
COPY --from=ghcr.io/astral-sh/uv:0.6.2 /uv /uvx /bin/ COPY --from=ghcr.io/astral-sh/uv:0.6.5 /uv /uvx /bin/
RUN apt-get update && apt-get -y upgrade && apt-get -y install sqlite3 RUN apt-get update && apt-get -y upgrade && apt-get -y install sqlite3
+21 -9
View File
@@ -52,8 +52,10 @@ class SetCog(commands.Cog, name="Set command."):
.where(col(CategoryGroup.guild_id) == interaction.guild_id) .where(col(CategoryGroup.guild_id) == interaction.guild_id)
.where(col(CategoryGroup.id) == int(group_id)) .where(col(CategoryGroup.id) == int(group_id))
) )
group = session.scalar(stmt) if (group := session.scalar(stmt)) is None:
group.ChannelId = channel_id await interaction.response.send_message("Group or Category was not found.", ephemeral=True)
return
group.channel_id = channel_id
session.commit() session.commit()
await interaction.send(f"Registered <#{channel_id}>.", ephemeral=True) await interaction.send(f"Registered <#{channel_id}>.", ephemeral=True)
@@ -88,8 +90,11 @@ class SetCog(commands.Cog, name="Set command."):
.where(col(CategoryGroup.guild_id) == interaction.guild_id) .where(col(CategoryGroup.guild_id) == interaction.guild_id)
.where(col(CategoryGroup.id) == int(group_id)) .where(col(CategoryGroup.id) == int(group_id))
) )
group = session.scalar(stmt) if (group := session.scalar(stmt)) is None:
group.PadLength = length await interaction.response.send_message("Group or Category was not found.", ephemeral=True)
return
group.pad_length = length
session.commit() session.commit()
await interaction.response.send_message( await interaction.response.send_message(
f"Category pad length set to {length} for {group.name}", ephemeral=True f"Category pad length set to {length} for {group.name}", ephemeral=True
@@ -120,7 +125,9 @@ class SetCog(commands.Cog, name="Set command."):
with Session(engine) as session: with Session(engine) as session:
stmt = select(Guild).where(col(Guild.id) == interaction.guild_id) stmt = select(Guild).where(col(Guild.id) == interaction.guild_id)
guild = session.scalar(stmt) if (guild := session.scalar(stmt)) is None:
await interaction.response.send_message("Guild was not found.", ephemeral=True)
return
guild.submission_channel = channel_id guild.submission_channel = channel_id
session.commit() session.commit()
await interaction.send(f"Registered <#{channel_id}>.", ephemeral=True) await interaction.send(f"Registered <#{channel_id}>.", ephemeral=True)
@@ -150,8 +157,11 @@ class SetCog(commands.Cog, name="Set command."):
.where(col(CategoryGroup.guild_id) == interaction.guild_id) .where(col(CategoryGroup.guild_id) == interaction.guild_id)
.where(col(CategoryGroup.id) == int(group_id)) .where(col(CategoryGroup.id) == int(group_id))
) )
group = session.scalar(stmt) if (group := session.scalar(stmt)) is None:
group.UsernameLength = length await interaction.response.send_message("Group or Category was not found.", ephemeral=True)
return
group.username_length = length
session.commit() session.commit()
await interaction.response.send_message(f"Username length set to {length}.", ephemeral=True) await interaction.response.send_message(f"Username length set to {length}.", ephemeral=True)
@@ -178,8 +188,10 @@ class SetCog(commands.Cog, name="Set command."):
with Session(engine) as session: with Session(engine) as session:
stmt = select(Guild).where(col(Guild.id) == interaction.guild_id) stmt = select(Guild).where(col(Guild.id) == interaction.guild_id)
guild = session.scalar(stmt) if (guild := session.scalar(stmt)) is None:
guild.VerificationChannel = channel_id await interaction.response.send_message("Guild was not found.", ephemeral=True)
return
guild.verification_channel = channel_id
session.commit() session.commit()
await interaction.send(f"Registered <#{channel_id}>.", ephemeral=True) await interaction.send(f"Registered <#{channel_id}>.", ephemeral=True)
+2 -2
View File
@@ -347,7 +347,7 @@ async def send_highscore_message(session: Session, guild: nextcord.Guild, group:
if group.message_id is None: if group.message_id is None:
# message doesn't exist. # message doesn't exist.
message: nextcord.Message = await channel.send(highscore_string) message: nextcord.Message = await channel.send(highscore_string)
group.id = message.id group.message_id = message.id
session.commit() session.commit()
else: else:
message: nextcord.Message = await channel.fetch_message(group.message_id) message: nextcord.Message = await channel.fetch_message(group.message_id)
@@ -390,7 +390,7 @@ async def submit_score(
existing_score = session.scalar(stmt) existing_score = session.scalar(stmt)
if existing_score: if existing_score:
existing_score.Score = score_f existing_score.score = score_f
else: else:
score_obj = Score(username=username, score=score_f, category_id=category_id) score_obj = Score(username=username, score=score_f, category_id=category_id)
session.add(score_obj) session.add(score_obj)