67 lines
1.7 KiB
Python
67 lines
1.7 KiB
Python
"""
|
|
Commands for testing.
|
|
"""
|
|
|
|
import nextcord
|
|
from nextcord.ext import commands
|
|
|
|
from classes.election_cycle import ElectionCycle
|
|
|
|
|
|
class TestCog(commands.Cog, name="Test commands."):
|
|
"""
|
|
Class holds commands for testing.
|
|
"""
|
|
|
|
def __init__(self, bot) -> None:
|
|
"""
|
|
Default constructor for HelpCog class. Does nothing.
|
|
"""
|
|
self.bot = bot
|
|
|
|
@nextcord.slash_command()
|
|
async def test(self, interaction: nextcord.Interaction):
|
|
"""
|
|
Parent slash command for help. Never called.
|
|
"""
|
|
|
|
@test.subcommand()
|
|
async def msg_builder(self, interaction: nextcord.Interaction):
|
|
"""
|
|
Tests the message builder.
|
|
|
|
Args:
|
|
interaction (nextcord.Interaction): Interaction that invoked the command.
|
|
"""
|
|
|
|
cycle = ElectionCycle(0, self.bot)
|
|
|
|
message = cycle.build_election_announcement()
|
|
|
|
# doesn't tell discord that the message was responded to. Is a test command so I don't really care atm.
|
|
for m in message:
|
|
await interaction.channel.send(content=m)
|
|
|
|
@test.subcommand()
|
|
async def election_start(self, interaction: nextcord.Interaction):
|
|
"""
|
|
idc
|
|
|
|
Args:
|
|
interaction (nextcord.Interaction): _description_
|
|
"""
|
|
|
|
cycle = ElectionCycle(0, self.bot)
|
|
await cycle.election_start_action()
|
|
|
|
@test.subcommand()
|
|
async def voting_start(self, interaction: nextcord.Interaction):
|
|
"""
|
|
tests the voting start action
|
|
|
|
Args:
|
|
interaction (nextcord.Interaction): _description_
|
|
"""
|
|
cycle = ElectionCycle(0, self.bot)
|
|
await cycle.voting_start_action()
|