Merge branch 'main' into 33-fixes-from-mock-election
build_develop / build (push) Successful in 1m24s
build_develop / build (push) Successful in 1m24s
This commit is contained in:
+11
-25
@@ -10,6 +10,17 @@ from config import DakinyConfig
|
|||||||
from utils import get_current_cycle
|
from utils import get_current_cycle
|
||||||
|
|
||||||
|
|
||||||
|
def is_me():
|
||||||
|
"""
|
||||||
|
predicate that makes sure only I can run the test commands.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def predicate(interaction: nextcord.Interaction):
|
||||||
|
return interaction.user.id == 206602713511886849
|
||||||
|
|
||||||
|
return application_checks.check(predicate)
|
||||||
|
|
||||||
|
|
||||||
class TestCog(commands.Cog, name="Test commands."):
|
class TestCog(commands.Cog, name="Test commands."):
|
||||||
"""
|
"""
|
||||||
Class holds commands for testing.
|
Class holds commands for testing.
|
||||||
@@ -21,37 +32,12 @@ class TestCog(commands.Cog, name="Test commands."):
|
|||||||
"""
|
"""
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
def is_me():
|
|
||||||
def predicate(interaction: nextcord.Interaction):
|
|
||||||
return interaction.user.id == 206602713511886849
|
|
||||||
|
|
||||||
return application_checks.check(predicate)
|
|
||||||
|
|
||||||
@nextcord.slash_command()
|
@nextcord.slash_command()
|
||||||
@is_me()
|
|
||||||
async def test(self, interaction: nextcord.Interaction):
|
async def test(self, interaction: nextcord.Interaction):
|
||||||
"""
|
"""
|
||||||
Parent slash command for help. Never called.
|
Parent slash command for help. Never called.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@test.subcommand()
|
|
||||||
@is_me()
|
|
||||||
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()
|
@test.subcommand()
|
||||||
@is_me()
|
@is_me()
|
||||||
async def election_start(self, interaction: nextcord.Interaction):
|
async def election_start(self, interaction: nextcord.Interaction):
|
||||||
|
|||||||
@@ -10,10 +10,8 @@ class Params:
|
|||||||
Class defines the various configuration parameters.
|
Class defines the various configuration parameters.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
active_category_id: int
|
|
||||||
admin_channel_id: int # might want to rename this...
|
admin_channel_id: int # might want to rename this...
|
||||||
announcement_category_id: int
|
announcement_category_id: int
|
||||||
archive_channel_group_id: int
|
|
||||||
clan_council_elect_role_id: int
|
clan_council_elect_role_id: int
|
||||||
clan_council_role_id: int
|
clan_council_role_id: int
|
||||||
clan_info_channel_id: int
|
clan_info_channel_id: int
|
||||||
|
|||||||
Reference in New Issue
Block a user