fix: Some typos in config.

This commit is contained in:
2025-09-24 21:14:58 +10:00
parent 7853d0c115
commit a19bb8a8cb

View File

@@ -359,6 +359,7 @@ class SubathonComponent(cmds.Component):
timecap_seconds = timecap * 60 * 60 if timecap else None timecap_seconds = timecap * 60 * 60 if timecap else None
subdata = await Subathon.create( subdata = await Subathon.create(
name="Subathon",
communityid=cid, communityid=cid,
initial_time=initial_time, initial_time=initial_time,
sub1_score=sub1, sub1_score=sub1,
@@ -545,9 +546,9 @@ class SubathonComponent(cmds.Component):
# timecamp # timecamp
cap = sdata.timecap or 0 cap = sdata.timecap or 0
caph = cap / 3600 caph = int(cap / 3600)
parts.append( parts.append(
f"cap=\"{caph}\" (hours, 0 means no cap)" f"cap={caph} (hours, 0 means no cap)"
) )
# scores # scores
@@ -624,7 +625,7 @@ class SubathonComponent(cmds.Component):
else: else:
# Display path # Display path
current_cap = active.subathondata.timecap or 0 current_cap = active.subathondata.timecap or 0
caph = current_cap / 3600 caph = int(current_cap / 3600)
await ctx.reply( await ctx.reply(
"Duration cap for this subathon, in hours, including the initial time. " "Duration cap for this subathon, in hours, including the initial time. "
"Contributions given after the cap has been reached will be accepted, " "Contributions given after the cap has been reached will be accepted, "
@@ -647,12 +648,12 @@ class SubathonComponent(cmds.Component):
# Setting path # Setting path
# Validate # Validate
splits = args.split() splits = args.split()
if not len(splits) == 4 and all(split.isdigit() for split in splits): if not len(splits) == 4 and all(split.isdecimal() for split in splits):
await ctx.reply( await ctx.reply(
f"USAGE: {ctx.prefix}subathon config socres [<t1score> <t2score> <t3score> <bitscore>]" f"USAGE: {ctx.prefix}subathon config socres [<t1score> <t2score> <t3score> <bitscore>]"
) )
return return
t1score, t2score, t3score, bitscore = map(int, splits) t1score, t2score, t3score, bitscore = map(float, splits)
await active.subathondata.update( await active.subathondata.update(
sub1_score=t1score, sub1_score=t1score,
sub2_score=t2score, sub2_score=t2score,