Give the elect role and set elected in database.
This commit is contained in:
+21
-2
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user