Discord RPC #
An Python wrapper for Discord RPC API. Allow you to make own custom RPC.
Install #
- PyPI
pip install discord-rpc
Quick example #
import discordrpc
rpc = discordrpc.RPC(app_id=12345678910)
rpc.set_activity(
state="A super simple rpc",
details="simple RPC"
)
# Required if you only run Discord RPC on this file or current instance.
rpc.run()
rpc.run()
is only used if you are only running Discord RPC on the current file/instance. If there are other programs/tasks on the current instance, rpc.run()
does not need to be used.
See documentation here.
More examples here.
Change Logs #
5.1 #
Updates :
- Added Activity Types (Listening, Watching, etc).
rpc.set_activity(act_type=0)
- Added more detailed information in the output.
5.0 #
Critical updates & changes :
- Inputting id is no longer in
RPC.set_id
. Replaced with inputing insideRPC
class.
Before:
rpc = discordrpc.RPC.set_id(app_id=1234567890)
After:
rpc = discordrpc.RPC(app_id=1234567890)
Updates :
-
Removing many functions. List:
RPC.set_id
RPC._connect
RPC._write
RPC._recv
RPC._recv_exact
- And many more…
-
Package
logging
is used again as output. -
Removing
timestamp
argument and addedts_start
andts_end
onset_activity()
as a replacement for the timestamp argument. -
Added
debug
parameter onRPC
class if you want to print more outputs. -
timestamp
variable is moved todiscordrpc.utils
. So if you want to import timestamp variable, usefrom discordrpc.utils import timestamp
-
button
ondiscordrpc.button
changed toButton
. -
added
date_to_timestamp
function ondiscordrpc.utils
. with format%d/%m/%Y-%H:%M:%S
orday/month/year-hour:minute:second
Example :date_to_timestamp('14/06/2025-00:00:00')
4.0 #
Critical update :
- Changing
DiscordRPC
folder (when you import the package) todiscordrpc
. Before :
import DiscordRPC
After :
import discordrpc
Updates :
- No longer using
logging
package. GCAR
orget_current_application_running
removed because it can’t be cross-platform (I spent days just looking for this solution lmao).setLoggerEnabled()
function removed.Set_ID
changed toset_id
.output()
function changed toshow_output
variable, Example.- Shorten the code in
presence.py
(not that much though).
3.0 #
New & Updates :
- Added
GCAR
method. GCAR : Get Current Application Running. Basically, you can switch your rpc status (state/details) automatically to the application you’re running
2.0 #
New & Updates :