mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-24 12:29:03 +08:00
Add: Discord presence
Not finished yet, but i think there is nothing more i can do
This commit is contained in:
24
module/webui/discord_presence.py
Normal file
24
module/webui/discord_presence.py
Normal file
@@ -0,0 +1,24 @@
|
||||
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())
|
||||
|
||||
|
||||
def init_discord_rpc():
|
||||
global process
|
||||
process = Process(target=run)
|
||||
process.start()
|
||||
|
||||
|
||||
def close_discord_rpc():
|
||||
global process
|
||||
process.terminate()
|
||||
Reference in New Issue
Block a user