Skip to content

Commit b664c95

Browse files
author
karel26
committed
BUGFIX:
- /serverload default period was not hour
1 parent 3124882 commit b664c95

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

plugins/serverstats/commands.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ def __init__(self, period: str = 'hour'):
2626
def list(bot: DCSServerBot) -> list[str]:
2727
return ['hour', 'day', 'week', 'month', 'today', 'yesterday']
2828

29+
@staticmethod
30+
def supports(bot: DCSServerBot, period: str) -> bool:
31+
return (period and period.startswith('period:')) or period in ServerLoadFilter.list(bot) or '-' in period
32+
2933
def filter(self, bot: DCSServerBot) -> str:
3034
if self.period == 'yesterday':
3135
return "DATE_TRUNC('day', time) = current_date - 1"

plugins/userstats/filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ async def autocomplete(self, interaction: discord.Interaction, current: str) ->
302302
periods.extend(flt.list(interaction.client))
303303
return [
304304
app_commands.Choice(name=x.title(), value=x)
305-
for x in sorted(periods)
305+
for x in periods
306306
if not current or current.casefold() in x.casefold()
307307
][:25]
308308
except Exception as ex:

0 commit comments

Comments
 (0)