#__init__() got an unexpected keyword argument 'ephemeral'
1 messages ยท Page 1 of 1 (latest)
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
The traceback you provided and the image traceback don't match
Literally read the image
And then read this traceback
They're not the same
Two different errors
they clearly are ion know whay u talking about ๐
i didnt send the whole image if u talking about that
whole image
"Local variable userid referenced before assignment"
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
You're passing ephemeral= to the embed
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)
Not the respond
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.
.solved