Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2596b9fa7b | ||
|
|
8c654612a9 | ||
|
|
e836ead399 | ||
|
|
fa691ced5d | ||
|
|
81f4c7741b | ||
|
|
ee7cbaf2f6 | ||
|
|
7ba7d3563c |
@@ -49,7 +49,7 @@ class RequestCog(commands.Cog, name="Request Commands"):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
config: DakinyConfig = self.bot.config
|
config: DakinyConfig = self.bot.config
|
||||||
content = f'<@{interaction.user.id}> would like to add presence" {presence}."'
|
content = f'<@{interaction.user.id}> would like to add presence "{presence}."'
|
||||||
view = PresenceChange(presence)
|
view = PresenceChange(presence)
|
||||||
await self.bot.get_channel(config.params.admin_channel_id).send(
|
await self.bot.get_channel(config.params.admin_channel_id).send(
|
||||||
content=content, view=view
|
content=content, view=view
|
||||||
|
|||||||
@@ -54,16 +54,16 @@ class ViewCog(commands.Cog, name="View Commands"):
|
|||||||
stmt = select(Presences.Presence)
|
stmt = select(Presences.Presence)
|
||||||
presences = session.scalars(stmt)
|
presences = session.scalars(stmt)
|
||||||
|
|
||||||
message = ""
|
|
||||||
|
|
||||||
# have 2 loops so that the "if search" check isn't done repeatedly
|
|
||||||
if search:
|
if search:
|
||||||
for presence in presences:
|
message = "\n".join(
|
||||||
if search.lower() in presence.lower():
|
[
|
||||||
message += f"{presence}\n"
|
presence
|
||||||
|
for presence in presences
|
||||||
|
if search.lower() in presence.lower()
|
||||||
|
]
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
for presence in presences:
|
message = "\n".join(list(presences))
|
||||||
message += f"{presence}\n"
|
|
||||||
|
|
||||||
await interaction.followup.send(content=message, ephemeral=True)
|
await interaction.followup.send(content=message, ephemeral=True)
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ def get_datetime(day: str) -> datetime:
|
|||||||
if datetime.today().month == 12 and month < 12:
|
if datetime.today().month == 12 and month < 12:
|
||||||
year += 1
|
year += 1
|
||||||
|
|
||||||
|
if datetime.today().month == 1 and month > 1:
|
||||||
|
year -= 1
|
||||||
|
|
||||||
return datetime(year, month, day)
|
return datetime(year, month, day)
|
||||||
|
|
||||||
|
|
||||||
@@ -88,7 +91,7 @@ def get_current_cycle(config: DakinyConfig) -> int:
|
|||||||
config (DakinyConfig): Config object to use
|
config (DakinyConfig): Config object to use
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
int: cycle index for active election. -1 for no active cycle
|
int: cycle index for active election. None for no active cycle
|
||||||
"""
|
"""
|
||||||
|
|
||||||
today = datetime.today()
|
today = datetime.today()
|
||||||
@@ -100,7 +103,7 @@ def get_current_cycle(config: DakinyConfig) -> int:
|
|||||||
):
|
):
|
||||||
return cycle
|
return cycle
|
||||||
|
|
||||||
return -1
|
return None
|
||||||
|
|
||||||
|
|
||||||
def build_votes_str(config: DakinyConfig) -> str:
|
def build_votes_str(config: DakinyConfig) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user