This commit is contained in:
@@ -49,7 +49,7 @@ class SetCog(commands.Cog, name="Set Commands"):
|
||||
return
|
||||
|
||||
# check if valid day
|
||||
today = datetime.now(tz=UTC).date()
|
||||
today = datetime.now(tz=UTC)
|
||||
try:
|
||||
birthday = datetime(today.year, month, day, tzinfo=UTC)
|
||||
except ValueError:
|
||||
|
||||
@@ -4,7 +4,6 @@ from typing import TYPE_CHECKING
|
||||
|
||||
import nextcord
|
||||
from nextcord.ext import application_checks, commands
|
||||
from nextcord.ext.application_checks.core import AC
|
||||
|
||||
from classes.election_cycle import ElectionCycle
|
||||
from utils import get_current_election_cycle
|
||||
@@ -17,7 +16,7 @@ ME = 206602713511886849
|
||||
GUILDS = [1000247361639030804]
|
||||
|
||||
|
||||
def is_me() -> AC:
|
||||
def is_me(): # noqa: ANN201
|
||||
"""Predicate that makes sure only I can run the test commands."""
|
||||
|
||||
def predicate(interaction: nextcord.Interaction) -> bool:
|
||||
@@ -53,7 +52,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
)
|
||||
await cycle.election_start_action()
|
||||
await interaction.send("Test command sent.")
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
|
||||
@test.subcommand()
|
||||
@is_me()
|
||||
@@ -71,7 +70,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
)
|
||||
await cycle.voting_start_action()
|
||||
await interaction.send("Test command sent.")
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
|
||||
@test.subcommand()
|
||||
@is_me()
|
||||
@@ -89,7 +88,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
)
|
||||
await cycle.voting_end_action()
|
||||
await interaction.send("Test command sent.")
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
|
||||
@test.subcommand()
|
||||
@is_me()
|
||||
@@ -107,7 +106,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
)
|
||||
await cycle.highcouncil_election_start_action()
|
||||
await interaction.send("Test command sent.")
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
|
||||
@test.subcommand()
|
||||
@is_me()
|
||||
@@ -125,7 +124,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
)
|
||||
await cycle.election_reminder()
|
||||
await interaction.send("Test command sent.")
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
|
||||
@test.subcommand()
|
||||
@is_me()
|
||||
@@ -143,7 +142,7 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
)
|
||||
await cycle.check_date()
|
||||
await interaction.send("Test command sent.")
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
|
||||
@test.subcommand()
|
||||
@is_me()
|
||||
@@ -161,4 +160,4 @@ class TestCog(commands.Cog, name="Test commands."):
|
||||
self.bot.get_guild(config.params.guild_id),
|
||||
)
|
||||
await cycle.term_start_action()
|
||||
await interaction.send("Test command sent.")
|
||||
await interaction.send("Test command sent.", ephemeral=True)
|
||||
|
||||
Reference in New Issue
Block a user