reticivis-net / mediaforge

A Discord bot for editing and creating videos, images, GIFs, and more!
https://discord.com/oauth2/authorize?client_id=780570413767983122
GNU General Public License v3.0
84 stars 28 forks source link

$twemoji not working - LookupError: Command raised an exception: LookupError: <ContextVar name='session' at 0x7f0d062e26b0> #170

Closed OffensiveLemon closed 1 year ago

OffensiveLemon commented 1 year ago

When I try to use $twemoji, I get the following error:

LookupError: Command raised an exception: LookupError: <ContextVar name='session' at 0x7f0d062e26b0>

DATETIME:2023-05-04 14:45:54.732178
COMMAND:$twemoji 😭
TRACEBACK:
Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/mediaforge-HXFskkj--py3.11/lib/python3.11/site-packages/discord/ext/commands/core.py", line 229, in wrapped
    ret = await coro(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mediaforge/src/commands/conversion.py", line 246, in twemoji
    await asyncio.gather(*[upload_url(url) for url in urls])
  File "/mediaforge/src/commands/conversion.py", line 241, in upload_url
    await ctx.reply(file=discord.File(await utils.web.saveurl(url)))
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mediaforge/src/utils/web.py", line 28, in saveurl
    name = reserve_tempfile(extension)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mediaforge/src/utils/tempfiles.py", line 58, in reserve_tempfile
    tfs = session.get()
          ^^^^^^^^^^^^^
LookupError: <ContextVar name='session' at 0x7f0d062e26b0>
reticivis-net commented 1 year ago

oh i think i know what is wrong here hold on should be a quick fix

OffensiveLemon commented 1 year ago

Cool, thanks