Originally created by FUFSoB.
- Put
discord.py
,setupRPC.rpy
andpython.zip
in yourgame
folder. - Edit your splash.rpy [all labels currently exist, you just need to add code] (code below)
- Create your own Rich Presence application on Discord API page, Video Guide (till 0:58)
- Edit
discord.py
, using yourapplication id
; addingassets
andtext
you wanted. - In
discord.py
add your own new states (make sure the names are memorable). - Add
$ state = "state name"
everywhere you wanted status to change. - Just run your game. First of all - it'll unzip
python.zip
and delete it after that. Then it will rewrite status to "Loading" and rundiscord.py
.
splash.rpy
label after_load:
# ...
if discordrun:
python:
try:
import io
import os
io.open("game/state.txt", 'w+', encoding = "utf-8").write(state)
except:
import io
open("game/state.txt", 'w+')
io.open("game/state.txt", 'w+', encoding = "utf-8").write("err3")
state = "err3"
# ...
return
label before_main_menu:
# ...
if discordrun:
python:
import io
state = "mm"
io.open("game/state.txt", 'w+', encoding = "utf-8").write(state)
# ...
return
label quit:
# ...
if discordrun:
python:
import os
os.popen('taskkill /f /im python.exe')
# ...
return