feat: add group duty pin notification feature
All checks were successful
CI / lint-and-test (push) Successful in 23s
All checks were successful
CI / lint-and-test (push) Successful in 23s
- Introduced a new configuration option `DUTY_PIN_NOTIFY` to control whether the bot re-pins the duty message when updated, providing notifications to group members. - Updated the architecture documentation to reflect the new functionality of re-pinning duty messages. - Enhanced the `.env.example` file to include the new configuration option with a description. - Added tests to verify the behavior of the new refresh pin command and its integration with the existing group duty pin functionality. - Updated internationalization messages to include help text for the new `/refresh_pin` command.
This commit is contained in:
@@ -64,6 +64,7 @@ class Settings:
|
||||
external_calendar_ics_url: str
|
||||
duty_display_tz: str
|
||||
default_language: str
|
||||
duty_pin_notify: bool
|
||||
|
||||
@classmethod
|
||||
def from_env(cls) -> "Settings":
|
||||
@@ -108,6 +109,8 @@ class Settings:
|
||||
duty_display_tz=os.getenv("DUTY_DISPLAY_TZ", "Europe/Moscow").strip()
|
||||
or "Europe/Moscow",
|
||||
default_language=normalize_lang(os.getenv("DEFAULT_LANGUAGE", "en")),
|
||||
duty_pin_notify=os.getenv("DUTY_PIN_NOTIFY", "1").strip().lower()
|
||||
not in ("0", "false", "no"),
|
||||
)
|
||||
|
||||
|
||||
@@ -128,6 +131,7 @@ CORS_ORIGINS = _settings.cors_origins
|
||||
EXTERNAL_CALENDAR_ICS_URL = _settings.external_calendar_ics_url
|
||||
DUTY_DISPLAY_TZ = _settings.duty_display_tz
|
||||
DEFAULT_LANGUAGE = _settings.default_language
|
||||
DUTY_PIN_NOTIFY = _settings.duty_pin_notify
|
||||
|
||||
|
||||
def is_admin(username: str) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user