Answers for "discord rich presence python"

4

discord.py presence

# Setting `Playing ` status
await bot.change_presence(activity=discord.Game(name="a game"))

# Setting `Streaming ` status
await bot.change_presence(activity=discord.Streaming(name="My Stream", url=my_twitch_url))

# Setting `Listening ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="a song"))

# Setting `Watching ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="a movie"))
Posted by: Guest on April-05-2021
1

discord rich presence python

import psutil
from pypresence import Presence
import time

client_id = '64567352374564'  # 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="RAM: "+str(mem_per)+"%", state="CPU: "+str(cpu_per)+"%"))  # Set the presence
    time.sleep(15) # Can only update rich presence every 15 seconds
Posted by: Guest on October-09-2020
2

how to make rich presence discord,py

await bot.change_presence(activity=discord.Game(name="Anything You Want"))
Posted by: Guest on June-04-2020
0

discord rich presence python

static void UpdatePresence()
{
    DiscordRichPresence discordPresence;
    memset(&discordPresence, 0, sizeof(discordPresence));
    discordPresence.state = "Subscribe";
    discordPresence.details = "Please";
    discordPresence.largeImageText = "Subscribe!";
    discordPresence.partyId = "https://www.youtube.com/channel/UC1kyU4bjMI1RAh3Qw5l0rsw";
    discordPresence.partySize = 1;
    discordPresence.partyMax = 6;
    discordPresence.joinSecret = "MTI4NzM0OjFpMmhuZToxMjMxMjM= ";
    Discord_UpdatePresence(&discordPresence);
}
Posted by: Guest on June-08-2021

Code answers related to "discord rich presence python"

Python Answers by Framework

Browse Popular Code Answers by Language