diff --git a/cogs/commands/view.py b/cogs/commands/view.py index dcf9c6d..b186812 100644 --- a/cogs/commands/view.py +++ b/cogs/commands/view.py @@ -14,6 +14,7 @@ from database_setup.sql_data_classes import ( Votes, engine, ) +from utils import VoteType class ViewCog(commands.Cog, name="View Commands"): @@ -148,6 +149,11 @@ class ViewCog(commands.Cog, name="View Commands"): election_name: str = nextcord.SlashOption( required=True, description="The election you want to view votes for." ), + election_type: str = nextcord.SlashOption( + required=True, + description="The election type. Council, Discord Manager, or Clan Leader.", + choices=VoteType, + ), ): """ Takes in an election name and sends a response message to the user with a list of people who voted in that @@ -159,7 +165,11 @@ class ViewCog(commands.Cog, name="View Commands"): election_name (str): Is SlashOption. The name of the election to view votes for. """ - stmt = select(Votes).where(Votes.ElectionCycle == election_name) + stmt = ( + select(Votes) + .where(Votes.ElectionCycle == election_name) + .where(Votes.Type == election_type) + ) with Session(engine) as session: # Check if election exists.