Skip to content

Commit

Permalink
add /pub link command and appropriate config entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie999 committed Dec 5, 2024
1 parent dbbfcb6 commit bf744a7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion example-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ emoji_reacts = "🚂😠🚇"
weekday = 3 # Thursday
hour = 20
channel_id = 1234567890
description = "Casual chat and food. All welcome."
description = "Casual chat and food. All welcome."
web_url = "https://example.com/"
2 changes: 1 addition & 1 deletion kmibot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class PubConfig(BaseModel):
weekday: int
hour: int
minute: int = 0

web_url: str

class FerryConfig(BaseModel):
api_url: str
Expand Down
11 changes: 11 additions & 0 deletions kmibot/modules/pub/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,18 @@ async def help(self, interaction: discord.Interaction) -> None: # noqa: A003
"/pub table <table_no> - add the table number and let others know",
"/pub attendees - get the people coming to the next pub, including AutoPub attendees",
"/pub change - move the location of the pub and ping all attendees.",
"/pub link - get a link to the website"
],
),
ephemeral=True,
)

@command(description="Get a link to the web service") # type: ignore[arg-type]
async def link(self, interaction: discord.Interaction) -> None: #noqa: A003
LOGGER.info(f"{interaction.user} used /pub link")
assert interaction.guild is not None

await interaction.response.send_message(
"Here you go:\n"+self.config.pub.web_url,
epheremal=True
)

0 comments on commit bf744a7

Please sign in to comment.