Remove old config command.
This commit is contained in:
@@ -494,44 +494,6 @@ class SubathonComponent(cmds.Component):
|
|||||||
else:
|
else:
|
||||||
await ctx.reply("No active subathon to adjust")
|
await ctx.reply("No active subathon to adjust")
|
||||||
|
|
||||||
# subathon config
|
|
||||||
@group_subathon.command(name='config', aliases=('option',))
|
|
||||||
@cmds.is_moderator()
|
|
||||||
async def cmd_subathon_config(self, ctx: Context, option: str, *, value: Optional[str] = None):
|
|
||||||
community = await self.bot.profiles.fetch_community(ctx.broadcaster)
|
|
||||||
cid = community.communityid
|
|
||||||
if (active := await self.get_active_subathon(cid)) is not None:
|
|
||||||
if option.lower() == 'cap':
|
|
||||||
if value:
|
|
||||||
# Set the timer cap
|
|
||||||
if not value.isdigit():
|
|
||||||
await ctx.reply("Timer cap must be an integer number of hours!")
|
|
||||||
else:
|
|
||||||
await active.subathondata.update(timecap=int(value * 60 * 60))
|
|
||||||
await self.dispatch_update(active)
|
|
||||||
await ctx.reply(
|
|
||||||
f"The timer cap has been set to {value} hours."
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
# Display the timer cap
|
|
||||||
cap = active.subathondata.timecap
|
|
||||||
if cap:
|
|
||||||
hours = cap / 3600
|
|
||||||
await ctx.reply(f"The timer cap is currently {hours} hours")
|
|
||||||
elif option.lower() == 'name':
|
|
||||||
if value:
|
|
||||||
await active.subathondata.update(name=value)
|
|
||||||
await self.dispatch_update(active)
|
|
||||||
await ctx.reply(f"Updated the subathon name to \"{value}\"")
|
|
||||||
else:
|
|
||||||
name = active.subathondata.name
|
|
||||||
await ctx.reply(f"This subathon is called \"{name}\"")
|
|
||||||
else:
|
|
||||||
# TODO: Add score and timescore config, probably move this to subcommands
|
|
||||||
await ctx.reply(
|
|
||||||
f"Unknown option {option}! Configurable options: 'name', 'cap'"
|
|
||||||
)
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
!subathon config
|
!subathon config
|
||||||
name="Birthday Subathon" ; cap=10 (hours) ; scores=5 10 20 0.1 (t1, t2, t3, and bit points) ; timescore=10 (seconds per point); Use !subathon config <option> [value] to see or set individual options
|
name="Birthday Subathon" ; cap=10 (hours) ; scores=5 10 20 0.1 (t1, t2, t3, and bit points) ; timescore=10 (seconds per point); Use !subathon config <option> [value] to see or set individual options
|
||||||
|
|||||||
Reference in New Issue
Block a user