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:
parent
85942723ab
commit
4ecac026b5
1 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import re
|
import re
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from typing import Optional
|
||||||
from config import AUTHORIZED_CHANNEL_ID, DIFFICULTY_SHORTCUTS, CLAN_ROLE_IDS
|
from config import AUTHORIZED_CHANNEL_ID, DIFFICULTY_SHORTCUTS, CLAN_ROLE_IDS
|
||||||
|
|
||||||
def parse_damage_amount(damage_str):
|
def parse_damage_amount(damage_str):
|
||||||
|
|
@ -43,7 +44,7 @@ def normalize_difficulty(difficulty):
|
||||||
return DIFFICULTY_SHORTCUTS[difficulty_lower]
|
return DIFFICULTY_SHORTCUTS[difficulty_lower]
|
||||||
return 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"""
|
"""Détecte le clan d'un membre via ses rôles Discord"""
|
||||||
for role in member.roles:
|
for role in member.roles:
|
||||||
if role.id in CLAN_ROLE_IDS:
|
if role.id in CLAN_ROLE_IDS:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue