feat: initial commit
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 4m50s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 4m50s
This commit is contained in:
29
bridge.py
Normal file
29
bridge.py
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Bridge messages from a Max group chat to a Telegram group using bot tokens."""
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
from bridge_app import parse_args, run_bridge
|
||||
|
||||
|
||||
def configure_logging(debug: bool) -> None:
|
||||
level = logging.DEBUG if debug else logging.INFO
|
||||
logging.basicConfig(
|
||||
level=level,
|
||||
format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
|
||||
)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
config, list_chats, debug = parse_args()
|
||||
configure_logging(debug)
|
||||
try:
|
||||
asyncio.run(run_bridge(config, list_chats))
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user