1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-11 19:48:21 +08:00
Files
AzurLaneAutoScript/module/webui/discord_presence.py
2022-01-10 00:42:40 +08:00

32 lines
545 B
Python

import time
from multiprocessing import Process
from pypresence import Presence
process: Process
def run():
APPLICATION_ID = "929437173764223057"
RPC = Presence(APPLICATION_ID)
RPC.connect()
RPC.update(
state="Alas is playing Azurlane",
start=time.time(),
large_image='alas'
)
def init_discord_rpc():
global process
process = Process(target=run)
process.start()
def close_discord_rpc():
global process
process.terminate()
if __name__ == '__main__':
init_discord_rpc()