Ask coding questions

← Back to all posts
Ehh, discord embeds wont work? :/
idksolol (2)

So since the replit "update" with .env discord embeds wont work anymore. The codes are correct (no errors) but when I use the command wish would send the embed it sended " <discord.embeds.Embed.object at 0x7f4fba5350d0> " instead! Before the "update" it just worked, after it it wont. Can anyone help??

This is my code:

prfx = "!"

Help_embed = discord.Embed(
title = "an title",
discription = "an discription",
colour = discord.Colour.orange())
Help_embed.add_field(name = "an field name", value = "field value")

@client.event
async def on_message(message):
if message.author == client.user:
return

msg = message.content

if msg.startswith(prfx + "help"):
await message.channel.send(Help_embed)

got ya @JULIODIAZ1 XD

Answered by Kai_Justice (278) [earned 5 cycles]
View Answer
Comments
hotnewtop
Kai_Justice (278)

await message.channel.send(embed=Help_embed)
It's a kwarg. You have to specify that you're sending an embed a long with the message.

idksolol (2)

@Kai_Justice thx man but it seems I can't run the script somehow! Do you mayby also know whats wrong? It has something to do with line 60:

if msg.startswith(prfx + "Shutdown"):

It gives the fellowing Error:

File "main.py", line 60
if msg.startswith(prfx + "Shutdown"):

(Arrow facing the ":" )
IndentationError: unindent does not match any outer indentation level.

Kai_Justice (278)

@idksolol That means your indentation is different for the line before or after, if this pops up randomly I usually just re-indent the whole script just to be sure it doesn't happen again.

idksolol (2)

@Kai_Justice I just re-indent the script, double checked it but I still cannot find whats wrong, can you may see in my script wats wrong??

Kai_Justice (278)

@idksolol I re-indented it all and it worked fine for me.
Here's the working version:
https://replit.com/@Kai_Justice/Client-test-30-1

idksolol (2)

@Kai_Justice Thank you verry much man, the bot is working fine now and I even got an bether embed tho! New lession learned XD

JULIODIAZ1 (50)

I cant help you because you actually put the code here instead of linking the repl.. also i know nothing about discord bots