Skip to content

Commit

Permalink
Upgrade syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
trickeydan committed Sep 14, 2024
1 parent 126e487 commit cbf743a
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 62 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/publish.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python: [ "3.10", "3.11", "3.12"]
python: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
Expand Down
31 changes: 1 addition & 30 deletions example-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,4 @@ emoji_reacts = "🚂😠🚇"
weekday = 3 # Thursday
hour = 20
channel_id = 1234567890
description = "Casual chat and food. All welcome."

[[pub.pubs]]
name = "The Fleming Arms"
emoji = "🦾"
menu_url = "https://www.hungryhorse.co.uk/pubs/hampshire/fleming-arms/menu/"
map_url = "https://g.page/theflemingarms"

[[pub.pubs]]
name = "Brewhouse and Kitchen"
emoji = "🍺"
menu_url = "https://www.brewhouseandkitchen.com/venue/southampton/"
map_url = "https://goo.gl/maps/F1JZ8WrzU1qx8bFp7"

[[pub.pubs]]
name = "Trago Lounge"
emoji = "🛋️"
menu_url = "https://thelounges.co.uk/trago/#menu"
map_url = "https://goo.gl/maps/ZzCziQ76zxV7x7uJ9"

[[pub.pubs]]
name = "The Cowherds"
emoji = "🐄"
menu_url = "https://www.vintageinn.co.uk/restaurants/south-east/thecowherdssouthampton/restaurantsfood#/"
map_url = "https://goo.gl/maps/mXFbSKJ2ZEzoTzat8"

[[pub.pubs]]
name = "The Crown Inn"
emoji = "👑"
map_url = "https://goo.gl/maps/k6ZDtKoxchDNK94WA"
description = "Casual chat and food. All welcome."
2 changes: 1 addition & 1 deletion kmibot/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class PubSchema(BaseModel):
id: UUID
name: str
emoji: str
menu_url: Optional[HttpUrl] = None
menu_url: HttpUrl | None = None
map_url: HttpUrl

@validator("menu_url", pre=True)
Expand Down
6 changes: 3 additions & 3 deletions kmibot/modules/ferry/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
TRAIN_PARTS = [":train:", ":railway_car:"]


def ferrify(count: int, seed: Optional[Any] = None) -> str:
def ferrify(count: int, seed: Any | None = None) -> str:
if count == 0:
return ""

Expand All @@ -51,8 +51,8 @@ async def get_leaderboard(self) -> str:

async def publish_accusation(
self,
criminal: Union[discord.User, discord.Member],
accuser: Union[discord.User, discord.ClientUser, discord.Member],
criminal: discord.User | discord.Member,
accuser: discord.User | discord.ClientUser | discord.Member,
quote: str,
) -> None:
try:
Expand Down
4 changes: 1 addition & 3 deletions kmibot/modules/ferry/modals.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ class AccuseModal(discord.ui.Modal):
required=True,
)

def __init__(
self, module: "FerryModule", *, criminal: Union[discord.User, discord.Member]
) -> None:
def __init__(self, module: "FerryModule", *, criminal: discord.User | discord.Member) -> None:
self.module = module
self.criminal = criminal
title = f"Accuse {criminal.display_name} of Ferrying"
Expand Down
2 changes: 1 addition & 1 deletion kmibot/modules/pub/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _get_next_pub_time(self) -> datetime:
tzinfo=self.config.timezone,
)

def _get_next_event(self, guild: discord.Guild) -> Optional[discord.ScheduledEvent]:
def _get_next_event(self, guild: discord.Guild) -> discord.ScheduledEvent | None:
pub_time = self._get_next_pub_time()
for event in guild.scheduled_events:
if event_is_pub(event) and event.start_time == pub_time:
Expand Down
2 changes: 1 addition & 1 deletion kmibot/modules/pub/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self, pubs: list[PubSchema], prompt: str) -> None:
self.prompt = prompt

self.selected = asyncio.Event()
self.pub: Optional[PubSchema] = None
self.pub: PubSchema | None = None

options = [discord.SelectOption(label=pub.name, emoji=pub.emoji) for pub in pubs]

Expand Down

0 comments on commit cbf743a

Please sign in to comment.