0

I was following I want to make a multi-page help command using discord.py but wanted to have embeds instead of messages for my help command. So far for testing I have..

@commands.command()
async def help(self, ctx):
        oneembed=discord.Embed(title="test1", color=0xAF0735)
        twoembed=discord.Embed(title="test2", color=0xAF0735)
        contents = [oneembed, twoembed]
        pages = 4
        cur_page = 1
        message = await ctx.send(embed=f"{contents[cur_page-1]}")

When i type the help command, it sends Page 1/4: <discord.embeds.Embed object at 0x0000018E68E98C10>

How can I get this to send the actual embed instead of the object?

ColeTMK
  • 96
  • 1
  • 10

1 Answers1

1

You should pass it as an embed like this

await ctx.send(embed=contents[cur_page-1])

TextChannel.send

Abdulaziz
  • 3,363
  • 1
  • 7
  • 24
  • I get this error `Ignoring exception in command help: Traceback (most recent call last): File "C:\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped ret = await coro(*args, **kwargs) File "C:\Users\colee\Documents\GitHub\Guard\cogs\MiscCommands.py", line 24, in help message = await ctx.send(embed=f"{contents[cur_page-1]}") File "C:\Python39\lib\site-packages\discord\abc.py", line 1017, in send embed = embed.to_dict() AttributeError: 'str' object has no attribute 'to_dict'` – ColeTMK Aug 04 '21 at 23:44
  • 1
    The first page in you code is an embed but other pages are strings, you have to make them all embeds. – Abdulaziz Aug 05 '21 at 09:44
  • I have updated my code.. I am still getting the same error. – ColeTMK Aug 05 '21 at 22:52
  • 1
    You were using f strings which will make the embed a string I have updated my code. – Abdulaziz Aug 06 '21 at 05:29