Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce FIFO command permission to "Administrator" #230

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions fifo/fifo.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from redbot.core.bot import Red
from redbot.core.commands import TimedeltaConverter
from redbot.core.utils.chat_formatting import humanize_timedelta, pagify
from redbot.core.utils.mod import is_admin_or_superior
from tzlocal import get_localzone

from .datetime_cron_converters import (
Expand Down Expand Up @@ -216,18 +217,17 @@ async def _get_tz(self, user: Union[discord.User, discord.Member]) -> Union[None
else:
return None

@checks.is_owner()
@commands.has_permissions(administrator=True)
@commands.guild_only()
@commands.command()
async def fifoclear(self, ctx: commands.Context):
"""Debug command to clear all current fifo data"""
self.scheduler.remove_all_jobs()
await self.config.guild(ctx.guild).tasks.clear()
await self.config.jobs.clear()
# await self.config.jobs_index.clear()
await ctx.tick()

@checks.is_owner() # Will be reduced when I figure out permissions later
@commands.has_permissions(administrator=True) # Adjust the permission as needed
@commands.guild_only()
@commands.group()
async def fifo(self, ctx: commands.Context):
Expand All @@ -236,6 +236,7 @@ async def fifo(self, ctx: commands.Context):
"""
pass


@fifo.command(name="wakeup")
async def fifo_wakeup(self, ctx: commands.Context):
"""Debug command to fix missed executions.
Expand Down
Loading