Compare commits

...
Author SHA1 Message Date
imcompiling ed0895056d remove quotes from type annotation.
build_develop / build (push) Successful in 1m23s
2024-05-22 22:48:54 -04:00
imcompiling 985e253954 edits to the pyproject.
build_develop / build (push) Successful in 1m23s
2024-05-22 21:59:12 -04:00
4 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -54,14 +54,14 @@ class RemoveCog(commands.Cog, name="Remove Commands"):
"""
with Session(engine) as session:
stmt = select(Presences)
presences_dict: "dict[str,str]" = {pres.Presence: str(pres.Id) for pres in session.scalars(stmt)}
presences_dict: dict[str,str] = {pres.Presence: str(pres.Id) for pres in session.scalars(stmt)}
# if empty compare string
if not presence_str:
await interaction.response.send_autocomplete(dict(list(presences_dict.items())[:25]))
return
autofilled_presences: "dict[str,str]" = {
autofilled_presences: dict[str,str] = {
pres: pres_id for pres, pres_id in presences_dict.items() if presence_str.lower() in pres.lower()
}
await interaction.response.send_autocomplete(autofilled_presences[:25])
+2 -2
View File
@@ -184,7 +184,7 @@ class ViewCog(commands.Cog, name="View Commands"):
await interaction.response.send_autocomplete(list(elections)[:25])
return
autofilled_elections: "list[str]" = [
autofilled_elections: list[str] = [
election for election in elections if election.lower().startswith(election_name.lower())
]
await interaction.response.send_autocomplete(autofilled_elections[:25])
@@ -207,7 +207,7 @@ class ViewCog(commands.Cog, name="View Commands"):
await interaction.response.send_autocomplete(list(quarters)[:25])
return
autofilled_quarters: "list[str]" = [
autofilled_quarters: list[str] = [
quarter for quarter in quarters if quarter.lower().startswith(quarter_name.lower())
]
await interaction.response.send_autocomplete(autofilled_quarters[:25])
+4
View File
@@ -4,6 +4,7 @@ version = "0.1.0"
description = "Dakiny's Discord Bot."
authors = ["imcompiling <[email protected]>"]
readme = "README.md"
package-mode = false
[tool.poetry.dependencies]
python = "^3.11"
@@ -18,6 +19,9 @@ sqlalchemy = "1.4.46"
aiofiles = "^23.2.1"
[tool.poetry.group.dev.dependencies]
ruff = "^0.4.5"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
-1
View File
@@ -1,6 +1,5 @@
"""File contains util functions."""
import calendar
import os
from collections.abc import Sequence
from datetime import UTC, datetime