Skip to content

Commit a663e3c

Browse files
committed
Add no-password support for Convoke
1 parent 0707093 commit a663e3c

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Support for no-password lobbies on convoke.
13+
1014
## [v17.1.2](https://github.com/lexicalunit/spellbot/releases/tag/v17.1.2) - 2025-11-18
1115

1216
### Fixed

src/spellbot/integrations/convoke.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
logger = logging.getLogger(__name__)
1919

20+
USE_PASSWORD = False # no password is now supported!
2021
RETRY_ATTEMPTS = 2
2122
TIMEOUT_S = 3
2223
ADJECTIVES = [
@@ -93,14 +94,16 @@ def convoke_game_format(format: GameFormat) -> ConvokeGameTypes: # pragma: no c
9394
return ConvokeGameTypes.Other
9495

9596

96-
def passphrase() -> str: # pragma: no cover
97-
return f"{random.choice(ADJECTIVES)} {random.choice(NOUNS)}" # noqa: S311
97+
def passphrase() -> str | None: # pragma: no cover
98+
if USE_PASSWORD:
99+
return f"{random.choice(ADJECTIVES)} {random.choice(NOUNS)}" # noqa: S311
100+
return None
98101

99102

100103
async def fetch_convoke_link( # pragma: no cover
101104
client: httpx.AsyncClient,
102105
game: GameDict,
103-
key: str,
106+
key: str | None,
104107
) -> dict[str, Any]:
105108
name = f"SB{game['id']}"
106109
sb_game_format = GameFormat(game["format"])
@@ -110,9 +113,10 @@ async def fetch_convoke_link( # pragma: no cover
110113
"name": name,
111114
"isPublic": False,
112115
"seatLimit": format[1],
113-
"password": key,
114116
"format": format[0],
115117
}
118+
if key:
119+
payload["password"] = key
116120
headers = {"user-agent": f"spellbot/{__version__}"}
117121
endpoint = f"{settings.CONVOKE_ROOT}/game/create-game"
118122
resp = await client.post(endpoint, json=payload, headers=headers)

0 commit comments

Comments
 (0)