Process voting end.
build_develop / build (push) Successful in 1m41s

Give the elect role and set elected in database.
This commit is contained in:
2023-11-03 15:06:52 -04:00
parent 66e7159022
commit 3fb65a7b0a
3 changed files with 56 additions and 4 deletions
+21 -2
View File
@@ -3,7 +3,7 @@ Commands for testing.
"""
import nextcord
from nextcord.ext import commands
from nextcord.ext import application_checks, commands
from classes.election_cycle import ElectionCycle
from config import DakinyConfig
@@ -21,7 +21,14 @@ class TestCog(commands.Cog, name="Test commands."):
"""
self.bot = bot
@nextcord.slash_command(default_member_permissions=nextcord.Permissions(administrator=True))
def is_me():
def predicate(interaction: nextcord.Interaction):
return interaction.user.id == 206602713511886849
return application_checks.check(predicate)
@nextcord.slash_command()
@is_me()
async def test(self, interaction: nextcord.Interaction):
"""
Parent slash command for help. Never called.
@@ -68,3 +75,15 @@ class TestCog(commands.Cog, name="Test commands."):
config: DakinyConfig = self.bot.config
cycle = ElectionCycle(get_current_cycle(config), config, self.bot.get_guild(config.params.guild_id))
await cycle.voting_start_action()
@test.subcommand()
async def voting_end(self, interaction: nextcord.Interaction):
"""
tests the voting start action
Args:
interaction (nextcord.Interaction): _description_
"""
config: DakinyConfig = self.bot.config
cycle = ElectionCycle(get_current_cycle(config), config, self.bot.get_guild(config.params.guild_id))
await cycle.voting_end_action()