2022-06-03 23:00:54 +08:00
|
|
|
import asyncio
|
2022-01-09 12:48:37 +08:00
|
|
|
import time
|
|
|
|
|
|
2022-06-03 23:00:54 +08:00
|
|
|
from pypresence import AioPresence
|
2022-01-09 12:48:37 +08:00
|
|
|
|
2022-06-03 23:00:54 +08:00
|
|
|
RPC = AioPresence("929437173764223057")
|
2022-01-09 12:48:37 +08:00
|
|
|
|
|
|
|
|
|
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")
|
2022-01-09 12:48:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def init_discord_rpc():
|
2022-06-03 23:00:54 +08:00
|
|
|
asyncio.create_task(run())
|
2022-01-09 12:48:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def close_discord_rpc():
|
2022-06-03 23:00:54 +08:00
|
|
|
RPC.close()
|
2022-01-10 00:42:40 +08:00
|
|
|
|
|
|
|
|
|
2022-02-24 22:09:59 +08:00
|
|
|
if __name__ == "__main__":
|
|
|
|
|
init_discord_rpc()
|