'how to add an image to user playing activity?(discord.py)
Iam trying to add image user activity status in discord.py and basically, the problem is that I can't seem to add an image so I looked up discord.py API but couldn't find how to do it. So if you know do answer.
Would like to know how to add one. (NOT FOR BOTS)
Here is the code
import discord, os, keep_alive, datetime
import discord.ext
from discord.ext import tasks
intents = discord.Intents.default()
client = discord.Client()
launch_time = datetime.datetime.utcnow()
@client.event
async def on_ready():
print("Account Activated")
print(launch_time)
if not Status_loop.is_running():
Status_loop.start()
Put it in a loop to constantly update the activity
@tasks.loop(seconds=1, count=None, reconnect=True)
async def Status_loop():
delta_uptime = datetime.datetime.utcnow() - launch_time
hours, remainder = divmod(int(delta_uptime.total_seconds()), 3600)
minutes, seconds = divmod(remainder, 60)
days, hours = divmod(hours, 24)
print(f"Online Time: {days:02d}d | {hours:02d}h | {minutes:02d}m | {seconds:02d}s")
await client.change_presence(status = discord.Status.dnd,
activity = discord.Activity(type=discord.ActivityType.playing,
large_image = "https://i.imgur.com/Kk2BvJg.jpg",
large_text = "This is Game Icon",
name = "Sleeping Simulator💤",
details = "Dreams of Desires(Easy)",
state = f"{days:02d}d | {hours:02d}h | {minutes:02d}m Passed"))
Here is the Status on a user account
If you are wondering why I am even doing this, well I just wanted a custom status
Solution 1:[1]
It seems that after trying sites and other kinds of ways to do it, I finally got it using replit uploaded file link... and it worked...
large_image = "https://e8a593e1-79cc-4f08-9992-2b588af90e7f.id.repl.co/static/sleepingface.jpg",
large_text = "This is Game Icon",
small_image = "https://e8a593e1-79cc-4f08-9992-2b588af90e7f.id.repl.co/static/sleepingface.jpg",
small_text = "This is Game Icon",
The result:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Twisted Reality |


