Skip to content
Sign upLog in

Why is this error occuring?

Profile icon
VulcanWMHacker

So I'm making this bot that stores its data in repl-db, but I'm not an expert in repl-db and now don't know why this error is occuring. The error is the picture below.

Screenshot from 2020-07-28 12-12-29

I have attached the repl, but place in the code where the error is occuring is below. The place where the error starts from is in line 78.

The error:

@client.command() async def prof(ctx): member1 = ctx.message.author member = str(member1) if member in await db.all(): credits = str(await db.view(member)) title = "Coins" else: credits = "You don't have an account. Do hi!setaccount to make an account." title = ":pensive:" embed = make_embed(title=member, desc="") embed.add_field(name=title, value=credits) await ctx.send(embed=embed)

Can somebody help me?
Thanks in advance.

You are viewing a single comment. View All
Profile icon
CodingCactus

You need to do credit = str(await db.view(member))

Profile icon
VulcanWM

Man it’s still not working.

@CodingCactus

Profile icon
CodingCactus

@VulcanWM
well I'm just looking at your whole snippet seeing as you haven't given a line number

Profile icon
CodingCactus

@VulcanWM
also what is the point of make_embed it seems completely redundant, just make an embed the normal way

Profile icon
VulcanWM

wdym normal way? The place where the error starts from is in line 78.

@CodingCactus

Profile icon
CodingCactus

@VulcanWM
tell me what line the error is on! Not the general section

Profile icon
CodingCactus

@VulcanWM

embed = discord.Embed(color=0x00ff00, title=‘plonk your title here’, description=‘plonk your description here’)

Profile icon
VulcanWM
Profile icon
CodingCactus

@VulcanWM
yeah it is await db.all not await.all**()**

Profile icon
VulcanWM
Profile icon
VulcanWM

Now it's showing me this error:

Screenshot from 2020-07-29 11-18-40

@CodingCactus

Profile icon
CodingCactus

@VulcanWM
would be a lot easier if you showed the actual error message rather than that thx

Profile icon
CodingCactus

@VulcanWM
don't do desc="" when you make an embed, that is probably your error

Profile icon
VulcanWM

When I do that, it says that Command raised an exception: TypeError: make_embed() missing 1 required positional argument: 'desc'

@CodingCactus

Profile icon
CodingCactus

@VulcanWM
yeah because you are using a stupid function which isn't needed

Profile icon
CodingCactus

@VulcanWM
just do

embed = discord.Embed(title='hi') embed.add_field(name='i dunno', value='bye')
Profile icon
VulcanWM
Profile icon
CodingCactus

@VulcanWM
you have a completely redundant function called make_embed it is just stupid

Profile icon
VulcanWM

I used your code, and HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In embed.fields.0.value: This field is required came up

@CodingCactus

Profile icon
VulcanWM

ok ok chill

@CodingCactus

Profile icon
CodingCactus

@VulcanWM
WHAT LINE???

Profile icon
VulcanWM

It says line 85. Below are two pictures of the error:
Screenshot from 2020-07-29 18-17-13


Screenshot from 2020-07-29 18-17-50

@CodingCactus

Profile icon
CodingCactus

@VulcanWM
ok, so what I think is happening is the variable credits is empty, try printing it