'\" t .\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "PYPRESENCE" "1" "Jul 13, 2024" "3.2" "pypresence" .SH NAME pypresence \- pypresence Documentation .SH INSTALLATION .sp \fBInstall pypresence with pip:\fP .sp For the last full release, you can use: .sp \fBpip install pypresence\fP .sp Or for the in\-development release, you can use: .sp \fBpip install https://github.com/qwertyquerty/pypresence/archive/master.zip\fP .SH LINKS .INDENT 0.0 .IP \(bu 2 \X'tty: link https://discord.gg/JF3kg77'\fI\%Discord Support Server\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://www.patreon.com/qwertyquerty'\fI\%Qwerty\(aqs Patreon (Some doll hairs would be nice)\fP\X'tty: link' .IP \(bu 2 \X'tty: link https://github.com/qwertyquerty/pypresence'\fI\%pypresence GitHub Repository\fP\X'tty: link' .UNINDENT .SH INFORMATION .SS About .sp Pypresence is a wrapper for Discord RPC. You can use it for Rich Presence for your games, as well as other discord integrations. .SS Changelog .SS 3.2.2 .INDENT 0.0 .IP \(bu 2 Fixed support for 3.7 .IP \(bu 2 Added nice \fBend_in()\fP method for Activities .IP \(bu 2 Fixed some loopy looper mistakes .UNINDENT .SS 3.2.1 .INDENT 0.0 .IP \(bu 2 FIXED A BUG THAT LITERALLY BROKE ANYTHING THAT WASN\(aqT THE ACTIVITY CLASS .IP \(bu 2 Began work on new docs .UNINDENT .SS 3.2.0 .INDENT 0.0 .IP \(bu 2 Added async clients, \fBAioClient()\fP and \fBAioPresence()\fP .IP \(bu 2 Added the useful tool of \fBActivity()\fP .IP \(bu 2 New (internally used) \fBPayload()\fP class .IP \(bu 2 Neko fixed some of qwerty\(aqs Y I K E S coding .UNINDENT .SS 3.1.1 .INDENT 0.0 .IP \(bu 2 Fix support for 3.5 (again) .IP \(bu 2 More small internal improvements .UNINDENT .SS 3.1.0 .INDENT 0.0 .IP \(bu 2 Support for python 3.5 .IP \(bu 2 Many small internal improvements .UNINDENT .SS 3.0.0 .INDENT 0.0 .IP \(bu 2 Added Response object, which is now returned instead of dicts .UNINDENT .SS Quickstart .TS box center; l. T{ This page exists for if you have literally no clue what you\(aqre doing, or you just need a quick start. (For rich presence) T} .TE .sp \fBThe first thing youll want to do is create a Discord RPC app. Here are the steps:\fP .INDENT 0.0 .IP \(bu 2 Navigate to \X'tty: link https://discord.com/developers/'\fI\%https://discord.com/developers/\fP\X'tty: link' .IP \(bu 2 Click \(dqCreate an Application.\(dq .IP \(bu 2 Setup the application how you want, give it the name you want, and give it a good image. .IP \(bu 2 Right under the name of your application, locate your Client ID. You will need this later. .IP \(bu 2 Lastly, save your application. .UNINDENT .sp \fBNext, you need to install pypresence. You will need python 3.5 \- 3.7 installed. Here are the steps:\fP .INDENT 0.0 .IP \(bu 2 Open command prompt .IP \(bu 2 Type \fBpip3 install pypresence\fP and hit enter .IP \(bu 2 It should say something near the end that says something like \fB\(dqSuccessfully installed pypresence\(dq\fP\&. .UNINDENT .sp \fBNow you will need to create the program to set your rich presence. First we need to import what we need, like so:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX from pypresence import Presence # The simple rich presence client in pypresence import time .EE .UNINDENT .UNINDENT .sp \fBNext we need to initialize our Rich Presence client. You\(aqll need that Client ID from earlier:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX client_id = \(dqID HERE\(dq # Put your Client ID in here RPC = Presence(client_id) # Initialize the Presence client .EE .UNINDENT .UNINDENT .sp \fBNow we need to connect our Client to Discord, so it can send presence updates:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX RPC.connect() # Start the handshake loop .EE .UNINDENT .UNINDENT .sp \fBNow we need to actually set our rich presence. We can use the update() function for this. There are many options we can use, but for this we will use state:\fP .INDENT 0.0 .INDENT 3.5 .sp .EX RPC.update(state=\(dqRich Presence using pypresence!\(dq) # Updates our presence .EE .UNINDENT .UNINDENT .sp \fBNow we need our program to run forever, so we use a while loop.\fP .INDENT 0.0 .INDENT 3.5 .sp .EX while True: # The presence will stay on as long as the program is running time.sleep(15) # Can only update rich presence every 15 seconds .EE .UNINDENT .UNINDENT .sp \fBNow when you run your program, it should look something like this!\fP .INDENT 0.0 .INDENT 2.5 [image: Finished Presence] [image] .UNINDENT .UNINDENT .SS Examples .sp \fBHere is a list of examples using pypresence:\fP .sp Basic Rich Presence: .INDENT 0.0 .INDENT 3.5 .sp .EX from pypresence import Presence import time client_id = \(aq64567352374564\(aq # Fake ID, put your real one here RPC = Presence(client_id) # Initialize the client class RPC.connect() # Start the handshake loop print(RPC.update(state=\(dqLookie Lookie\(dq, details=\(dqA test of qwertyquerty\(aqs Python Discord RPC wrapper, pypresence!\(dq)) # Set the presence while True: # The presence will stay on as long as the program is running time.sleep(15) # Can only update rich presence every 15 seconds .EE .UNINDENT .UNINDENT .sp .sp Rich Presence to show CPU usage: .INDENT 0.0 .INDENT 3.5 .sp .EX import psutil from pypresence import Presence import time client_id = \(aq64567352374564\(aq # Fake ID, put your real one here RPC = Presence(client_id,pipe=0) # Initialize the client class RPC.connect() # Start the handshake loop while True: # The presence will stay on as long as the program is running cpu_per = round(psutil.cpu_percent(),1) # Get CPU Usage mem = psutil.virtual_memory() mem_per = round(psutil.virtual_memory().percent,1) print(RPC.update(details=\(dqRAM: \(dq+str(mem_per)+\(dq%\(dq, state=\(dqCPU: \(dq+str(cpu_per)+\(dq%\(dq)) # Set the presence time.sleep(15) # Can only update rich presence every 15 seconds .EE .UNINDENT .UNINDENT .sp .sp Rich Presence to loop through quotes: .INDENT 0.0 .INDENT 3.5 .sp .EX from pypresence import Presence import time import random client_id = \(aq64567352374564\(aq # Put your Client ID here, this is a fake ID RPC = Presence(client_id) # Initialize the Presence class RPC.connect() # Start the handshake loop quotes = [ \(dqIf you can dream it, you can achieve it.\(dq, \(dqEither write something worth reading or do something worth writing.\(dq, \(dqYou become what you believe.\(dq, \(dqFall seven times and stand up eight.\(dq, \(dqThe best revenge is massive success.\(dq, \(dqEighty percent of success is showing up.\(dq, \(dqLife is what happens to you while you’re busy making other plans.\(dq, \(dqStrive not to be a success, but rather to be of value.\(dq, \(dqThe best time to plant a tree was 20 years ago. The second best time is now.\(dq, \(dqEverything you’ve ever wanted is on the other side of fear.\(dq ] # The quotes to choose from while True: # The presence will stay on as long as the program is running RPC.update(details=\(dqFamous Quote:\(dq, state=random.choice(quotes)) #Set the presence, picking a random quote time.sleep(60) #Wait a wee bit .EE .UNINDENT .UNINDENT .sp .sp \fBFurthermore, the following is a list of repositories which use pypresence\fP .SH DOCUMENTATION .SS Presence() .INDENT 0.0 .TP .B class Presence(client_id, pipe=0, loop=None, handler=None) Creates the Presence client ready for usage. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBclient_id\fP (\fIstr\fP) \-\- OAuth2 App ID (found \X'tty: link https://discord.com/developers/applications/me'\fI\%here\fP\X'tty: link') .IP \(bu 2 \fBpipe\fP (\fIint\fP) \-\- Pipe that should be used to connect to the Discord client. Defaults to 0, can be 0\-9 .IP \(bu 2 \fBloop\fP (\fIasyncio.BaseEventLoop\fP) \-\- Your own event loop (if you have one) that PyPresence should use. One will be created if not supplied. Information at \X'tty: link https://docs.python.org/3/library/asyncio-eventloop.html'\fI\%https://docs.python.org/3/library/asyncio\-eventloop.html\fP\X'tty: link' .IP \(bu 2 \fBhandler\fP (\fIfunction\fP) \-\- The exception handler pypresence should send asynchronous errors to. This can be a coroutine or standard function as long as it takes two arguments (exception, future). Exception will be the exception to handle and future will be an instance of asyncio.Future .UNINDENT .UNINDENT .UNINDENT .sp .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .B connect() Initializes the connection \- must be done in order to make any updates to Rich Presence. .INDENT 7.0 .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B clear(pid=os.getpid()) Clears the presence. .INDENT 7.0 .TP .B Parameters \fBpid\fP (\fIint\fP) \-\- the process id of your game .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B close() Closes the connection. .INDENT 7.0 .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B update(**options) Sets the user\(aqs presence on Discord. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpid\fP (\fIint\fP) \-\- the process id of your game .IP \(bu 2 \fBstate\fP (\fIstr\fP) \-\- the user\(aqs current status .IP \(bu 2 \fBdetails\fP (\fIstr\fP) \-\- what the player is currently doing .IP \(bu 2 \fBstart\fP (\fIint\fP) \-\- epoch time for game start .IP \(bu 2 \fBend\fP (\fIint\fP) \-\- epoch time for game end .IP \(bu 2 \fBlarge_image\fP (\fIstr\fP) \-\- name of the uploaded image for the large profile artwork .IP \(bu 2 \fBlarge_text\fP (\fIstr\fP) \-\- tooltip for the large image .IP \(bu 2 \fBsmall_image\fP (\fIstr\fP) \-\- name of the uploaded image for the small profile artwork .IP \(bu 2 \fBsmall_text\fP (\fIstr\fP) \-\- tootltip for the small image .IP \(bu 2 \fBparty_id\fP (\fIstr\fP) \-\- id of the player\(aqs party, lobby, or group .IP \(bu 2 \fBparty_size\fP (\fIlist\fP) \-\- current size of the player\(aqs party, lobby, or group, and the max in this format: \fB[1,4]\fP .IP \(bu 2 \fBjoin\fP (\fIstr\fP) \-\- unique hashed string for chat invitations and ask to join .IP \(bu 2 \fBspectate\fP (\fIstr\fP) \-\- unique hashed string for spectate button .IP \(bu 2 \fBmatch\fP (\fIstr\fP) \-\- unique hashed string for spectate and join .IP \(bu 2 \fBbuttons\fP (\fIlist\fP) \-\- list of dicts for buttons on your profile in the format \fB[{\(dqlabel\(dq: \(dqMy Website\(dq, \(dqurl\(dq: \(dqhttps://qtqt.cf\(dq}, ...]\fP, can list up to two buttons .IP \(bu 2 \fBinstance\fP (\fIbool\fP) \-\- marks the match as a game session with a specific beginning and end .UNINDENT .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .UNINDENT .UNINDENT .SS Client() .INDENT 0.0 .TP .B class Client(client_id, pipe=0, loop=None, handler=None) Creates the RPC client ready for usage. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBclient_id\fP (\fIstr\fP) \-\- OAuth2 App ID (found at \X'tty: link https://discord.com/developers/applications/me'\fI\%https://discord.com/developers/applications/me\fP\X'tty: link') .IP \(bu 2 \fBpipe\fP (\fIint\fP) \-\- Pipe that should be used to connect to the Discord client. Defaults to 0, can be 0\-9 .IP \(bu 2 \fBloop\fP (\fIasyncio.BaseEventLoop\fP) \-\- Your own event loop (if you have one) that PyPresence should use. One will be created if not supplied. Information at \X'tty: link https://docs.python.org/3/library/asyncio-eventloop.html'\fI\%https://docs.python.org/3/library/asyncio\-eventloop.html\fP\X'tty: link' .IP \(bu 2 \fBhandler\fP (\fIfunction\fP) \-\- The exception handler pypresence should send asynchronous errors to. This can be a coroutine or standard function as long as it takes two arguments (exception, future). Exception will be the exception to handle and future will be an instance of asyncio.Future .UNINDENT .UNINDENT .UNINDENT .sp .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .B start() Initializes the connection \- must be done in order to run RPC commands. .INDENT 7.0 .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B close() Closes the connection. .UNINDENT .sp .INDENT 0.0 .TP .B authorize(client_id, scopes, rpc_token=None, username=None) Used to authenticate a new client with your app. By default this pops up a modal in\-app that asks the user to authorize access to your app. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBclient_id\fP (\fIstr\fP) \-\- OAuth2 application id .IP \(bu 2 \fBscopes\fP (\fIlist\fP) \-\- a list of OAuth scopes as strings .IP \(bu 2 \fBrpc_token\fP (\fIstr\fP) \-\- one\-time use RPC token .IP \(bu 2 \fBusername\fP (\fIstr\fP) \-\- username to create a guest account with if the user does not have Discord .UNINDENT .TP .B Return type pypresence.Response .UNINDENT .sp All the different scopes can be found \X'tty: link https://discord.com/developers/docs/topics/oauth2'\fI\%here\fP\X'tty: link' .UNINDENT .sp .INDENT 0.0 .TP .B authenticate(token) Used to authenticate an existing client with your app. .INDENT 7.0 .TP .B Parameters \fBtoken\fP (\fIint\fP) \-\- OAuth2 access token .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B get_guilds() Used to get a list of guilds the client is in. .INDENT 7.0 .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B get_channels() Used to get a guild\(aqs channels the client is in. .INDENT 7.0 .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B channel_id() Used to get a channel the client is in. .INDENT 7.0 .TP .B Parameters \fBchannel_id\fP (\fIstr\fP) \-\- id of the channel to get .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B set_user_voice_settings(user_id, **options) Used to get a channel the client is in. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBuser_id\fP (\fIstr\fP) \-\- user id .IP \(bu 2 \fBpan_left\fP (\fIfloat\fP) \-\- left pan of the user .IP \(bu 2 \fBpan_right\fP (\fIfloat\fP) \-\- right pan of the user .IP \(bu 2 \fBvolume\fP (\fIint\fP) \-\- the volume of user (defaults to 100, min 0, max 200) .IP \(bu 2 \fBmute\fP (\fIbool\fP) \-\- the mute state of the user .UNINDENT .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B select_voice_channel(channel_id) Used to join and leave voice channels, group dms, or dms. .INDENT 7.0 .TP .B Parameters \fBchannel_id\fP (\fIstr\fP) \-\- channel id to join (or \fBNone\fP to leave) .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B get_selected_voice_channel() Used to get the client\(aqs current voice channel. .INDENT 7.0 .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B select_text_channel(channel_id) Used to join and leave text channels, group dms, or dms. .INDENT 7.0 .TP .B Parameters \fBchannel_id\fP (\fIstr\fP) \-\- channel id to join (or \fBNone\fP to leave) .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B set_activity(**options) Used to set the activity shown on Discord profiles and status of users. Takes the following as parameters. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpid\fP (\fIint\fP) \-\- the process id of your game .IP \(bu 2 \fBstate\fP (\fIstr\fP) \-\- the user\(aqs current status .IP \(bu 2 \fBdetails\fP (\fIstr\fP) \-\- what the player is currently doing .IP \(bu 2 \fBstart\fP (\fIint\fP) \-\- epoch time for game start .IP \(bu 2 \fBend\fP (\fIint\fP) \-\- epoch time for game end .IP \(bu 2 \fBlarge_image\fP (\fIstr\fP) \-\- name of the uploaded image for the large profile artwork .IP \(bu 2 \fBlarge_text\fP (\fIstr\fP) \-\- tooltip for the large image .IP \(bu 2 \fBsmall_image\fP (\fIstr\fP) \-\- name of the uploaded image for the small profile artwork .IP \(bu 2 \fBsmall_text\fP (\fIstr\fP) \-\- tootltip for the small image .IP \(bu 2 \fBparty_id\fP (\fIstr\fP) \-\- id of the player\(aqs party, lobby, or group .IP \(bu 2 \fBparty_size\fP (\fIlist\fP) \-\- current size of the player\(aqs party, lobby, or group, and the max in this format: \fB[1,4]\fP .IP \(bu 2 \fBjoin\fP (\fIstr\fP) \-\- unique hashed string for chat invitations and ask to join .IP \(bu 2 \fBspectate\fP (\fIstr\fP) \-\- unique hashed string for spectate button .IP \(bu 2 \fBmatch\fP (\fIstr\fP) \-\- unique hashed string for spectate and join .IP \(bu 2 \fBbuttons\fP (\fIlist\fP) \-\- list of dicts for buttons on your profile in the format \fB[{\(dqlabel\(dq: \(dqMy Website\(dq, \(dqurl\(dq: \(dqhttps://qtqt.cf\(dq}, ...]\fP, can list up to two buttons .IP \(bu 2 \fBinstance\fP (\fIbool\fP) \-\- marks the match as a game session with a specific beginning and end .UNINDENT .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B clear_activity(pid=os.getpid()) Clear the activity. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpid\fP (\fIint\fP) \-\- the process id of your game .IP \(bu 2 \fBstate\fP (\fIstr\fP) \-\- the user\(aqs current status .IP \(bu 2 \fBdetails\fP (\fIstr\fP) \-\- what the player is currently doing .IP \(bu 2 \fBstart\fP (\fIint\fP) \-\- epoch time for game start .IP \(bu 2 \fBend\fP (\fIint\fP) \-\- epoch time for game end .IP \(bu 2 \fBlarge_image\fP (\fIstr\fP) \-\- name of the uploaded image for the large profile artwork .IP \(bu 2 \fBlarge_text\fP (\fIstr\fP) \-\- tooltip for the large image .IP \(bu 2 \fBsmall_image\fP (\fIstr\fP) \-\- name of the uploaded image for the small profile artwork .IP \(bu 2 \fBsmall_text\fP (\fIstr\fP) \-\- tootltip for the small image .IP \(bu 2 \fBparty_id\fP (\fIstr\fP) \-\- id of the player\(aqs party, lobby, or group .IP \(bu 2 \fBparty_size\fP (\fIlist\fP) \-\- current size of the player\(aqs party, lobby, or group, and the max in this format: \fB[1,4]\fP .IP \(bu 2 \fBjoin\fP (\fIstr\fP) \-\- unique hashed string for chat invitations and ask to join .IP \(bu 2 \fBspectate\fP (\fIstr\fP) \-\- unique hashed string for spectate button .IP \(bu 2 \fBmatch\fP (\fIstr\fP) \-\- unique hashed string for spectate and join .IP \(bu 2 \fBinstance\fP (\fIbool\fP) \-\- marks the match as a game session with a specific beginning and end .UNINDENT .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B subscribe(event, args={}) Used to subscribe to events. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBevent\fP (\fIstr\fP) \-\- event name to subscribe to .IP \(bu 2 \fBargs\fP (\fIdict\fP) \-\- any args to go along with the event .UNINDENT .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B unsubscribe(event, args={}) Used to unsubscribe from events. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBevent\fP (\fIstr\fP) \-\- event name to unsubscribe from .IP \(bu 2 \fBargs\fP (\fIdict\fP) \-\- any args to go along with the event .UNINDENT .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B get_voice_settings() Get the user\(aqs voice settings. .INDENT 7.0 .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B set_voice_settings(**options) Set the user\(aqs voice settings. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fB_input\fP (\fIdict\fP) \-\- input settings .IP \(bu 2 \fBoutput\fP (\fIdict\fP) \-\- output settings .IP \(bu 2 \fBmode\fP (\fIdict\fP) \-\- voice mode settings .IP \(bu 2 \fBautomatic_gain_control\fP (\fIbool\fP) \-\- state of automatic gain control .IP \(bu 2 \fBecho_cancellation\fP (\fIbool\fP) \-\- state of echo cancellation .IP \(bu 2 \fBnoise_suppression\fP (\fIbool\fP) \-\- state of noise suppression .IP \(bu 2 \fBqos\fP (\fIbool\fP) \-\- state of voice quality of service .IP \(bu 2 \fBsilence_warning\fP (\fIbool\fP) \-\- state of silence warning notice .IP \(bu 2 \fBdeaf\fP (\fIbool\fP) \-\- state of self\-deafen .IP \(bu 2 \fBmute\fP (\fIbool\fP) \-\- state of self\-mute .UNINDENT .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B capture_shortcut(action) Used to capture a keyboard shortcut entered by the user. .INDENT 7.0 .TP .B Parameters \fBaction\fP (\fIstring\fP) \-\- capture action, either \fB\(aqSTART\(aq\fP or \fB\(aqSTOP\(aq\fP .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B send_activity_join_invite(user_id) Used to accept an Ask to Join request. .INDENT 7.0 .TP .B Parameters \fBuser_id\fP (\fIstr\fP) \-\- user id .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B close_activity_request(user_id) Used to reject an Ask to Join request. .INDENT 7.0 .TP .B Parameters \fBuser_id\fP (\fIstr\fP) \-\- user id .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B register_event(event, func, args={}) Hook an event to a function. The function will be called whenever Discord sends that event. Will auto subscribe to it. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBevent\fP (\fIstr\fP) \-\- the event to hook .IP \(bu 2 \fBfunc\fP (\fIfunction\fP) \-\- the function to pair with the event .IP \(bu 2 \fBargs\fP (\fIdict\fP) \-\- optional args used in subscription .UNINDENT .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .INDENT 0.0 .TP .B unregister_event(event, args={}) Unhook an event from a function. Will auto unsubscribe from the event as well. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBevent\fP (\fIstr\fP) \-\- the event to unhook .IP \(bu 2 \fBargs\fP (\fIdict\fP) \-\- optional args used in unsubscription .UNINDENT .TP .B Return type pypresence.Response .UNINDENT .UNINDENT .sp .UNINDENT .UNINDENT .SH AUTHOR qwertyquerty, LewdNeko .SH COPYRIGHT 2024, qwertyquerty .\" Generated by docutils manpage writer. .