Skip to content

Commit

Permalink
Fix 'automatic' command
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfspencer committed Sep 19, 2019
1 parent ccfec15 commit 8a5a735
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion foodflex/util/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
5 changes: 5 additions & 0 deletions foodflex/util/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8a5a735

Please sign in to comment.