Add env configuration for lurker.vibe
This commit is contained in:
parent
2ed360e42b
commit
da6c22d1f4
@ -1,2 +1,6 @@
|
|||||||
|
# lurker.vibe
|
||||||
|
API_URL="https://localhost/api/presences"
|
||||||
|
API_TOKEN="Bearer token"
|
||||||
|
|
||||||
# dbmate
|
# dbmate
|
||||||
DATABASE_URL=""
|
DATABASE_URL=""
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import typing
|
import typing
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -10,8 +11,8 @@ from loguru import logger
|
|||||||
T = typing.TypeVar("T")
|
T = typing.TypeVar("T")
|
||||||
FlushFunc = typing.Callable[[list[T]], typing.Coroutine[typing.Any, typing.Any, bool]]
|
FlushFunc = typing.Callable[[list[T]], typing.Coroutine[typing.Any, typing.Any, bool]]
|
||||||
|
|
||||||
API_URL = "https://requestbin.io/17ifjd71"
|
API_URL = os.getenv("API_URL")
|
||||||
API_TOKEN = ""
|
API_TOKEN = os.getenv("API_TOKEN")
|
||||||
|
|
||||||
|
|
||||||
class SpotifyRecord(typing.NamedTuple):
|
class SpotifyRecord(typing.NamedTuple):
|
||||||
@ -105,6 +106,10 @@ def main(argv: typing.Sequence[str]):
|
|||||||
print("Usage: lurker.py <token>")
|
print("Usage: lurker.py <token>")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
if not API_URL:
|
||||||
|
print("Missing `API_URL` environment variable.")
|
||||||
|
return 1
|
||||||
|
|
||||||
Bot().run(argv[0])
|
Bot().run(argv[0])
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user