Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

discord py bot status

# Status to Online (The green one)
await client.change_presence(status=discord.Status.online)

# Status to Idle (The orange one)
await client.change_presence(status=discord.Status.idle)

# Status to Do not disturb (The red one)
await client.change_presence(status=discord.Status.dnd)
Comment

discord.py change status

# Playing ____
await bot.change_presence(activity=discord.Game(name='Minecraft'))
# Streaming ____
await bot.change_presence(activity=discord.Streaming(name="Chess", url=twitch_url))
# Watching ____
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="Harry Potter"))
# Competing in ____
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.competing, name="the House Cup"))
# Listening to ____
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="!help"))
Comment

Get game status discord.py

@bot.event
async def on_member_update(prev,cur):       


    games = ["overwatch", "rocket league", "minecraft", "stardew valley"]
    
    print(cur.activity.name.lower())
    if cur.activity and cur.activity.name.lower() in games:
            #do something
Comment

PREVIOUS NEXT
Code Example
Python :: get time taken to execute python script 
Python :: python divide string in half 
Python :: python print colored text 
Python :: python blender select object by name 
Python :: list files in directory python 
Python :: suffixes in pandas 
Python :: python read url 
Python :: list to json python 
Python :: python get ros package path 
Python :: df from numpy array 
Python :: how to pause code for some time in python 
Python :: openpyxl read excel 
Python :: matplotlib grid in background 
Python :: tan for python 
Python :: python read entire file as string 
Python :: python datetime now minus 3 hours 
Python :: To check pip version 
Python :: best games made in pygame 
Python :: how to add images in hml while using flask 
Python :: python read xls 
Python :: how to find if a value is even or odd in python 
Python :: discord.py play mp3 file 
Python :: how to return the derivative of a function in python 
Python :: pandas to_csv append 
Python :: scikit learn r2 score 
Python :: pandas shift column 
Python :: python datetime strptime hour minute second 
Python :: trigonometry in python 
Python :: convert tuple to array python 
Python :: send email python 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =