chore: add changelog and documentation updates
All checks were successful
CI / lint-and-test (push) Successful in 17s
All checks were successful
CI / lint-and-test (push) Successful in 17s
- Created a new `CHANGELOG.md` file to document all notable changes to the project, adhering to the Keep a Changelog format. - Updated `CONTRIBUTING.md` to include instructions for building and previewing documentation using MkDocs. - Added `mkdocs.yml` configuration for documentation generation, including navigation structure and theme settings. - Enhanced various documentation files, including API reference, architecture overview, configuration reference, and runbook, to provide comprehensive guidance for users and developers. - Included new sections in the README for changelog and documentation links, improving accessibility to project information.
This commit is contained in:
@@ -91,6 +91,7 @@ async def _schedule_next_update(
|
||||
|
||||
|
||||
async def update_group_pin(context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||
"""Job callback: refresh pinned duty message and schedule next update at shift end."""
|
||||
chat_id = context.job.data.get("chat_id")
|
||||
if chat_id is None:
|
||||
return
|
||||
@@ -117,6 +118,7 @@ async def update_group_pin(context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||
async def my_chat_member_handler(
|
||||
update: Update, context: ContextTypes.DEFAULT_TYPE
|
||||
) -> None:
|
||||
"""Handle bot added to or removed from group: send/pin duty message or delete pin record."""
|
||||
if not update.my_chat_member or not update.effective_user:
|
||||
return
|
||||
old = update.my_chat_member.old_chat_member
|
||||
@@ -185,6 +187,7 @@ def _get_all_pin_chat_ids_sync() -> list[int]:
|
||||
|
||||
|
||||
async def restore_group_pin_jobs(application) -> None:
|
||||
"""Restore scheduled pin-update jobs for all chats that have a pinned message (on startup)."""
|
||||
loop = asyncio.get_running_loop()
|
||||
chat_ids = await loop.run_in_executor(None, _get_all_pin_chat_ids_sync)
|
||||
for chat_id in chat_ids:
|
||||
@@ -194,6 +197,7 @@ async def restore_group_pin_jobs(application) -> None:
|
||||
|
||||
|
||||
async def pin_duty_cmd(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||
"""Handle /pin_duty: pin the current duty message in the group (reply to bot's message)."""
|
||||
if not update.message or not update.effective_chat or not update.effective_user:
|
||||
return
|
||||
chat = update.effective_chat
|
||||
|
||||
Reference in New Issue
Block a user