chhangement du comportement du discord bot sur modif des matchs
CI - Security, Lint & Tests / validate (push) Failing after 59s
CI - Security, Lint & Tests / validate (push) Failing after 59s
This commit is contained in:
@@ -60,7 +60,9 @@ def zip_participants(player_ids, participant_ids):
|
||||
yield player_id, participant_ids[index] if index < len(participant_ids) else None
|
||||
|
||||
|
||||
def notify_participants(*, title, date, start_time, end_time, participants, fallback_id):
|
||||
def notify_participants(
|
||||
*, title, date, start_time, end_time, participants, fallback_id, change_kind='scheduled'
|
||||
):
|
||||
"""Tell each participant that a match has been scheduled or changed.
|
||||
|
||||
Args:
|
||||
@@ -73,6 +75,8 @@ def notify_participants(*, title, date, start_time, end_time, participants, fall
|
||||
attendance lands on the right row.
|
||||
fallback_id: Reference to use when a participant row has no id —
|
||||
the match's own, which the bot can still act on.
|
||||
change_kind: 'scheduled' (new match / new player added) or
|
||||
'modified' (date/time changed for existing players).
|
||||
|
||||
Returns:
|
||||
int: How many notifications were handed to the bot.
|
||||
@@ -91,6 +95,7 @@ def notify_participants(*, title, date, start_time, end_time, participants, fall
|
||||
event_date=event_date,
|
||||
event_time=event_time,
|
||||
reference_id=participant_id or fallback_id,
|
||||
change_kind=change_kind,
|
||||
)
|
||||
sent += 1
|
||||
return sent
|
||||
|
||||
Reference in New Issue
Block a user