1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-17 07:35:25 +08:00
Files
AzurLaneAutoScript/module/webui/discord_presence.py

24 lines
393 B
Python
Raw Normal View History

2022-06-03 23:00:54 +08:00
import asyncio
import time
2022-06-03 23:00:54 +08:00
from pypresence import AioPresence
2022-06-03 23:00:54 +08:00
RPC = AioPresence("929437173764223057")
2022-06-03 23:00:54 +08:00
async def run():
await RPC.connect()
await RPC.update(state="Alas is playing Azurlane", start=time.time(), large_image="alas")
def init_discord_rpc():
2022-06-03 23:00:54 +08:00
asyncio.create_task(run())
def close_discord_rpc():
2022-06-03 23:00:54 +08:00
RPC.close()
2022-01-10 00:42:40 +08:00
if __name__ == "__main__":
init_discord_rpc()