Compare commits
9
Commits
170ce1cbfb
...
v4.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f735e6d846 | ||
|
|
9fbaf7bcf6 | ||
|
|
c25d354fc0 | ||
|
|
e5d90a71d9 | ||
|
|
74ce22dd26 | ||
|
|
f52b2fe49f | ||
|
|
24a9fa998a | ||
|
|
63db4c1dd2 | ||
|
|
8604ba2547 |
Vendored
+1
-1
@@ -10,7 +10,7 @@
|
||||
"ondelete"
|
||||
],
|
||||
"python.analysis.diagnosticSeverityOverrides": {
|
||||
"reportOptionalMemberAccess": false,
|
||||
"reportOptionalMemberAccess": "warning",
|
||||
"reportArgumentType": "information",
|
||||
"reportAttributeAccessIssue": "warning"
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
FROM python:3.12.3-slim
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
+21
-9
@@ -52,8 +52,10 @@ class SetCog(commands.Cog, name="Set command."):
|
||||
.where(col(CategoryGroup.guild_id) == interaction.guild_id)
|
||||
.where(col(CategoryGroup.id) == int(group_id))
|
||||
)
|
||||
group = session.scalar(stmt)
|
||||
group.ChannelId = channel_id
|
||||
if (group := session.scalar(stmt)) is None:
|
||||
await interaction.response.send_message("Group or Category was not found.", ephemeral=True)
|
||||
return
|
||||
group.channel_id = channel_id
|
||||
session.commit()
|
||||
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.id) == int(group_id))
|
||||
)
|
||||
group = session.scalar(stmt)
|
||||
group.PadLength = length
|
||||
if (group := session.scalar(stmt)) is None:
|
||||
await interaction.response.send_message("Group or Category was not found.", ephemeral=True)
|
||||
return
|
||||
|
||||
group.pad_length = length
|
||||
session.commit()
|
||||
await interaction.response.send_message(
|
||||
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:
|
||||
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
|
||||
session.commit()
|
||||
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.id) == int(group_id))
|
||||
)
|
||||
group = session.scalar(stmt)
|
||||
group.UsernameLength = length
|
||||
if (group := session.scalar(stmt)) is None:
|
||||
await interaction.response.send_message("Group or Category was not found.", ephemeral=True)
|
||||
return
|
||||
|
||||
group.username_length = length
|
||||
session.commit()
|
||||
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:
|
||||
stmt = select(Guild).where(col(Guild.id) == interaction.guild_id)
|
||||
guild = session.scalar(stmt)
|
||||
guild.VerificationChannel = channel_id
|
||||
if (guild := session.scalar(stmt)) is None:
|
||||
await interaction.response.send_message("Guild was not found.", ephemeral=True)
|
||||
return
|
||||
guild.verification_channel = channel_id
|
||||
session.commit()
|
||||
await interaction.send(f"Registered <#{channel_id}>.", ephemeral=True)
|
||||
|
||||
|
||||
+2
-2
@@ -347,7 +347,7 @@ async def send_highscore_message(session: Session, guild: nextcord.Guild, group:
|
||||
if group.message_id is None:
|
||||
# message doesn't exist.
|
||||
message: nextcord.Message = await channel.send(highscore_string)
|
||||
group.id = message.id
|
||||
group.message_id = message.id
|
||||
session.commit()
|
||||
else:
|
||||
message: nextcord.Message = await channel.fetch_message(group.message_id)
|
||||
@@ -390,7 +390,7 @@ async def submit_score(
|
||||
existing_score = session.scalar(stmt)
|
||||
|
||||
if existing_score:
|
||||
existing_score.Score = score_f
|
||||
existing_score.score = score_f
|
||||
else:
|
||||
score_obj = Score(username=username, score=score_f, category_id=category_id)
|
||||
session.add(score_obj)
|
||||
|
||||
Reference in New Issue
Block a user