Skip to main content

RPC 모듈 - @ZEV 가 만든 파이썬 유일한 디스코드 rpc

Project description

Vendy RPC Modules

Discord RPC 모듈 - Discord Gateway WebSocket을 통한 Rich Presence 관리

설치

pip install vendy-rpc-modules

사용법

기본 사용

from Vendy_RPC_modules import RPCManager, RPCConfig, RPCUser

# 설정
CONFIG: RPCConfig = {
    "RESTART_INTERVAL_MS": 10 * 60 * 1000,  # 10분
    "STATUS_CHECK_INTERVAL_MS": 60 * 1000,  # 1분
    "LOGIN_RETRIES": 3,
    "LOGIN_RETRY_DELAY_MS": 5000,
}

# 사용자 데이터
USERS: list[RPCUser] = [
    {
        "userID": "YOUR_USER_ID",
        "token": "YOUR_DISCORD_TOKEN",
        "name": "사용자 이름",
        "type": "PLAYING",
        "state": "상태 텍스트",
        "details": "상세 정보",
        "large_image": "",
        "largete": "",
        "small_image": "",
        "smallte": "",
        "button1": "",
        "button1link": "",
        "button2": "",
        "button2link": "",
    },
]

# 실행
if __name__ == "__main__":
    manager = RPCManager(config=CONFIG, users=USERS)
    manager.run()

고급 사용

from Vendy_RPC_modules import Client, RichPresence, ActivityType

# 단일 클라이언트 사용
client = Client()
client.on('ready', lambda: print("준비 완료!"))
client.on('error', lambda err: print(f"오류: {err}"))

client.login("YOUR_DISCORD_TOKEN")

# Rich Presence 설정
presence = RichPresence(client)
presence.set_application_id("817229550684471297")
presence.set_type(ActivityType.PLAYING)
presence.set_state("게임 중")
presence.set_details("상세 정보")
presence.set_assets_large_image("image_key")
presence.add_button("버튼", "https://example.com")

client.user['setActivity'](presence)

기능

  • ✅ Discord Gateway WebSocket을 통한 Rich Presence 관리
  • ✅ 여러 클라이언트 동시 관리
  • ✅ 자동 재시작 기능
  • ✅ 상태 확인 루프
  • ✅ 로그인 재시도 로직
  • ✅ 타입 힌트 지원 (IDE 자동완성)

요구사항

  • Python 3.7 이상
  • websocket-client >= 1.6.0

라이선스

MIT License

기여

이슈 및 풀 리퀘스트를 환영합니다!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vendy_rpc-1.0.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vendy_rpc-1.0.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file vendy_rpc-1.0.0.tar.gz.

File metadata

  • Download URL: vendy_rpc-1.0.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for vendy_rpc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 24c3e4431612a8a9d446bcfacb9dc83be2a8235002abdd2f0df476dcb97ec80e
MD5 ff46f82112a5e8d4b062254b834b44d9
BLAKE2b-256 492392f83cdcd8495a45a9cbe4dd07187ca363d6138c5afb4fa78592eedf15f4

See more details on using hashes here.

File details

Details for the file vendy_rpc-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: vendy_rpc-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for vendy_rpc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5983ab0946da4d8bd03e06f9eb41d31882236040f8495d187d831ffef1265a3
MD5 7a915c8e4a7ababd440b0fd1d138b965
BLAKE2b-256 cda068a5cb35338593e18a02d8cf8bd1b209f63b57f3e687cde2b9d5cce1fd87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page