Skip to content

Commit

Permalink
Add pause command
Browse files Browse the repository at this point in the history
  • Loading branch information
ctmbl committed Oct 27, 2024
1 parent a6ec2b2 commit 530a58d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/bot/root_pythia_cogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,21 @@ async def status(self, ctx):
f"- alive: {bot_loop_alive}\n"
)

@commands.command(name="pause")
async def pause(self, ctx):
"""
The bot enters its idle state
"""
rate_limiter = self.dbmanager.get_api_manager().get_rate_limiter()
if rate_limiter.is_idle():
await ctx.message.channel.send("The Rate Limiter is already idle, can't pause.")
return

rate_limiter.go_idle(manually = True)
await ctx.message.channel.send(
"Bot is in idle state, no requests will be sent."
)

@commands.command(name="resume")
async def resume(self, ctx):
"""
Expand Down

0 comments on commit 530a58d

Please sign in to comment.