#__init__() got an unexpected keyword argument 'ephemeral'

1 messages ยท Page 1 of 1 (latest)

round pumice
#

getting the weirdest error

#

entire traceback

init() got an unexpected keyword argument 'ephemeral'
Ignoring exception in command random:
Traceback (most recent call last):
File "C:\Users\damps\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 124, in wrapped
ret = await coro(arg)
File "C:\Users\damps\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 974, in _invoke
await self.callback(ctx, **kwargs)
File "c:\Users\damps\Desktop\New folder\main.py", line 125, in RandomMemory
user = client.get_user(userid)
UnboundLocalError: local variable 'userid' referenced before assignment

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\damps\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\bot.py", line 1088, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\damps\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 374, in invoke
await injected(ctx)
File "C:\Users\damps\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 132, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: UnboundLocalError: local variable 'userid' referenced before assignment

plain arrow
round pumice
#

whats the difference

plain arrow
#

Literally read the image

plain arrow
#

They're not the same

#

Two different errors

round pumice
#

they clearly are ion know whay u talking about ๐Ÿ’€

#

i didnt send the whole image if u talking about that

#

whole image

plain arrow
#

"Local variable userid referenced before assignment"

round pumice
#

yeah coz i put it in a try error

#

so actual problem still inside the ephemeral thing as it was supposed to return after sending

plain arrow
#

You're passing ephemeral= to the embed

round pumice
#
    try:
        if tag != "p": 
            tempStor = client.db.get_random_element(tag)
        else:
            tempStor = client.db.get_random_element()
        print(tempStor)

        if tempStor == None:
            await ctx.respond(embed = discord.Embed(title ="Dummy empty head, add more core memories!", color=discord.Color.from_rgb(255,255,255), ephemeral=True))
            return


        userid = tempStor["user_id"]
        tag = tempStor["tag"]
        file_url = tempStor["file_url"]
        context = tempStor["context"]
        timestamp = tempStor["timestamp"]
    except Exception as a:
        print(a)    

    user = client.get_user(userid)
plain arrow
#

Not the respond

round pumice
#

o

#

damn im so dumb ty

smoky galleon
#

๐Ÿ’€

#

.close

pine terraceBOT
#

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @elder oar.

Backup bot: </solved:1109625445990793246> (or .solved) with @pine terrace.

meager coyote
#

.solved