1# Setting `Playing ` status
2await bot.change_presence(activity=discord.Game(name="a game"))
3
4# Setting `Streaming ` status
5await bot.change_presence(activity=discord.Streaming(name="My Stream", url=my_twitch_url))
6
7# Setting `Listening ` status
8await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="a song"))
9
10# Setting `Watching ` status
11await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="a movie"))
12
1import psutil
2from pypresence import Presence
3import time
4
5client_id = '64567352374564' # Fake ID, put your real one here
6RPC = Presence(client_id,pipe=0) # Initialize the client class
7RPC.connect() # Start the handshake loop
8
9
10while True: # The presence will stay on as long as the program is running
11 cpu_per = round(psutil.cpu_percent(),1) # Get CPU Usage
12 mem = psutil.virtual_memory()
13 mem_per = round(psutil.virtual_memory().percent,1)
14 print(RPC.update(details="RAM: "+str(mem_per)+"%", state="CPU: "+str(cpu_per)+"%")) # Set the presence
15 time.sleep(15) # Can only update rich presence every 15 seconds
16
1static void UpdatePresence()
2{
3 DiscordRichPresence discordPresence;
4 memset(&discordPresence, 0, sizeof(discordPresence));
5 discordPresence.state = "Subscribe";
6 discordPresence.details = "Please";
7 discordPresence.largeImageText = "Subscribe!";
8 discordPresence.partyId = "https://www.youtube.com/channel/UC1kyU4bjMI1RAh3Qw5l0rsw";
9 discordPresence.partySize = 1;
10 discordPresence.partyMax = 6;
11 discordPresence.joinSecret = "MTI4NzM0OjFpMmhuZToxMjMxMjM= ";
12 Discord_UpdatePresence(&discordPresence);
13}