diff --git a/foodflex/util/commands.py b/foodflex/util/commands.py index 4169c29..6608603 100644 --- a/foodflex/util/commands.py +++ b/foodflex/util/commands.py @@ -58,8 +58,8 @@ async def state(ctx): @bot.command(description='Switch to automatic time-based control') async def automatic(ctx): - data.set_mode('automatic') await ctx.send('Now in automatic mode') + data.set_mode('automatic') @bot.command(description='Start submissions period') diff --git a/foodflex/util/data.py b/foodflex/util/data.py index 6f2e6bb..8e6381f 100644 --- a/foodflex/util/data.py +++ b/foodflex/util/data.py @@ -25,10 +25,15 @@ def change_period(new_period, manual_change=False): period = new_period save_state() + def set_mode(new_mode): + global mode + + logger.info(f'Mode \'{mode}\' -> \'{new_mode}\'') mode = new_mode save_state() + def load_state(): global participants, voting_map, period, mode