Skip to content

Commit

Permalink
Queue toggle and Unqueue functions
Browse files Browse the repository at this point in the history
These should not be needed when queue is functioning correctly and are in place as contingencies when a server admin is not available to troubleshoot. Queue toggle bypasses the queuing mechanism allowing approving flags for upvotes irrespective of bot voting mana. Unqueue may be used if a comment is noticed to have already been voted on but, for whatever reason, the SQL did not properly execute. This has not really been an issue since the pre-vote check has been implemented.
  • Loading branch information
anthonyadavisii authored Jan 24, 2019
1 parent e93aee4 commit d975fca
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions sfrbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,37 @@ async def queue(ctx):

@bot.command()
async def clear_queue(ctx):
"""
Clears entire voting queue
"""
cursor.execute('UPDATE steemflagrewards SET queue = 0 WHERE queue == 1')
db.commit()
await ctx.send('Queue has been successfully cleared!')
return

@bot.command()
async def unqueue(ctx,permlink):
"""
Removes post from queue by given permlink.
"""
cursor.execute('UPDATE steemflagrewards SET queue = 0 WHERE comment == ?',('@'+permlink,))
db.commit()
await ctx.send('@'+permlink+' successfully removed from queue!')
return

@bot.command()
async def queue_toggle(ctx):
"""
Toggles bypass for queuing mechanism. If queue_bypass already set to TRUE, will set back to FALSE and vice versa.
"""
global queue_bypass
if queue_bypass == False:
queue_bypass = True
await ctx.send('Enabled queue override.')
else:
queue_bypass = False
await ctx.send('Disabled queue override')
return

@bot.command()
async def sdl(ctx, cmd: str, *mode: str):
Expand Down

0 comments on commit d975fca

Please sign in to comment.