Discord.py:如何在我的 Discord 机器人的丰富存在中添加图像?

时间:2021-05-05 02:27:15

标签: python python-3.x discord.py

我最近在开发一个机器人,我知道我也可以在 Bot 的 Rich 状态中添加图像。所以我创建了另一个机器人来测试它。我为它阅读了 documentation 并尝试了一下,但没有得到任何结果。

代码:

import discord
from discord.ext import commands

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

@ndcr.event
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? :/')

所以我想要的是向我展示我想要的图像。 This 是我想在现场添加的图片。

即使在此代码之后,存在的外观也是如此:

Current Presence

注意:我已经尝试在 small_image_textlarge_image_text 中添加此链接。每次一次。然而没有运气。


如果我做错了什么,请告诉我,如果可能,请给我一些关于我的代码的示例。

谢谢! :D

1 个答案:

答案 0 :(得分:1)

您无法向机器人的活动添加图像。可以通过 EasyRP 等程序自定义显示在您帐户上的 Rich Presence。

您可以在这里查看:https://github.com/Pizzabelly/EasyRP