Discord.py: How do I add an image in my discord bot’s rich presence?

I was working on a bot recently and I got to know that I can add images in Bot's Rich presence too. So I created another Bot to test it. I read the documentation for it and gave it a try but didn't get any result.

The code:

import discord
from discord.ext import commands

ndcr = commands.Bot(command_prefix='>', intents=discord.Intents.all(), case_insensitive=True)

async def on_ready():
    print("ONLINE NOW ;)")
    botactivity = discord.Activity(type=discord.ActivityType.watching, name="for crimes in New Delhi and conducting hearings for them.", large_image_url='https://www.kindpng.com/picc/m/290-2907032_court-quest-court-clipart-hd-png-download.png')
    await ndcr.change_presence(activity=botactivity, status=discord.Status.do_not_disturb)

ndcr.run('Hidden Bruh. Why do you wanna see it? :/')

So what I want is that is show me the image I want it to. This is the image I want to add in the presence.

This is how the presence look even after this code:

Current Presence

Note: I have tried adding this link in small_image_text and large_image_text already. Once each time. Yet no luck.

Please let me know if there is anything I am doing wrong and if possible give me some example with respect to my code.

Thank You! :D

Read more here: https://stackoverflow.com/questions/67394415/discord-py-how-do-i-add-an-image-in-my-discord-bots-rich-presence

Content Attribution

This content was originally published by Bhavyadeep Yadav at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: