fix: replace str | None with Optional[str] for Python 3.9 compat

str | None union syntax requires Python 3.10+, bot runs on 3.9-slim.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
LE BERRE Mickael 2026-05-18 10:47:20 +02:00
parent 85942723ab
commit 4ecac026b5

View file

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import re
from datetime import datetime
from typing import Optional
from config import AUTHORIZED_CHANNEL_ID, DIFFICULTY_SHORTCUTS, CLAN_ROLE_IDS
def parse_damage_amount(damage_str):
@ -43,7 +44,7 @@ def normalize_difficulty(difficulty):
return DIFFICULTY_SHORTCUTS[difficulty_lower]
return difficulty_lower
def get_clan_from_member(member) -> str | None:
def get_clan_from_member(member) -> Optional[str]:
"""Détecte le clan d'un membre via ses rôles Discord"""
for role in member.roles:
if role.id in CLAN_ROLE_IDS: