diff --git a/cogs/commands/view.py b/cogs/commands/view.py index 872c1e8..56b600e 100644 --- a/cogs/commands/view.py +++ b/cogs/commands/view.py @@ -5,7 +5,6 @@ Commands for viewing information in the database. import nextcord import pandas as pd from nextcord.ext import commands -from numpy import indices from sqlalchemy import select from sqlalchemy.orm import Session @@ -59,8 +58,13 @@ class ViewCog(commands.Cog, name="View Commands"): con=engine, ) - cycles = df.groupby("Cycle") + if df.empty: + await interaction.followup.send( + f'Quarter "{quarter_name}" is invalid.', ephemeral=True + ) + return + cycles = df.groupby("Cycle") content = "" for cycle in cycles.groups: content += f"```{cycle}```\n"