modmail-dev / Modmail

A Discord bot that functions as a shared inbox between staff and members, similar to Reddit's Modmail.
https://docs.modmail.dev
GNU Affero General Public License v3.0
1.57k stars 4.59k forks source link

[BUG]: RuntimeError when attempting to re-login with presence intent disabled. #3203

Closed Jerrie-Aries closed 1 year ago

Jerrie-Aries commented 1 year ago

Bot Version

v4.0.1

How are you hosting Modmail?

Other

Error Logs

See below.

Screenshots

RuntimeError

Additional Information

RuntimeError when attempting to re-login with presence intent disabled.

This error was originally reported by a user in support server, here.

How to reproduce:

Error:

2022-09-23 07:25:25 __main__[192] - DEBUG: Successfully configured logging.
2022-09-23 07:25:25 __main__[149] - INFO: -------------------------
2022-09-23 07:25:25 __main__[150] - INFO: ┌┬┐┌─┐┌┬┐┌┬┐┌─┐┬┬
2022-09-23 07:25:25 __main__[151] - INFO: ││││ │ │││││├─┤││
2022-09-23 07:25:25 __main__[152] - INFO: ┴ ┴└─┘─┴┘┴ ┴┴ ┴┴┴─┘
2022-09-23 07:25:25 __main__[153] - INFO: v4.0.1
2022-09-23 07:25:25 __main__[154] - INFO: Authors: kyb3r, fourjr, Taaku18
2022-09-23 07:25:25 __main__[155] - INFO: -------------------------
2022-09-23 07:25:25 __main__[156] - INFO: discord.py: v2.0.1
2022-09-23 07:25:25 __main__[157] - INFO: -------------------------
2022-09-23 07:25:26 __main__[238] - WARNING: Attempting to login with only the server members and message content privileged intent. Some plugins might not work correctly.
2022-09-23 07:25:26 __main__[249] - CRITICAL: Fatal exception
Traceback (most recent call last):
  File "/User/Projects/modmail/bot.py", line 242, in runner
    await self.start(self.token)
  File "/User/Projects/modmail/.venv/lib/python3.9/site-packages/discord/client.py", line 745, in start
    await self.login(token)
  File "/User/Projects/modmail/.venv/lib/python3.9/site-packages/discord/client.py", line 580, in login
    data = await self.http.static_login(token)
  File "/User/Projects/modmail/.venv/lib/python3.9/site-packages/discord/http.py", line 801, in static_login
    data = await self.request(Route('GET', '/users/@me'))
  File "/User/Projects/modmail/.venv/lib/python3.9/site-packages/discord/http.py", line 624, in request
    async with self.__session.request(method, url, **kwargs) as response:
  File "/User/Projects/modmail/.venv/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "/User/Projects/modmail/.venv/lib/python3.9/site-packages/aiohttp/client.py", line 399, in _request
    raise RuntimeError("Session is closed")
RuntimeError: Session is closed
2022-09-23 07:25:26 __main__[290] - INFO: Cleaning up tasks.
2022-09-23 07:25:26 __main__[296] - INFO: Closing the event loop.
SawshaDev commented 1 year ago

If you dont have the intents enabled in the Developer Dashboard, please enable them. what this error shows is that your bot application does not have the privileged intent you need, enabled.

ghost commented 1 year ago

If you dont have the intents enabled in the Developer Dashboard, please enable them. what this error shows is that your bot application does not have the privileged intent you need, enabled.

Yeah Jerrie is aware of that, hes just made this issue so he can push a PR linked to this which fixes this. Presence intent isn't something thats needed for the core bot to work.

SawshaDev commented 1 year ago

Yeah Jerrie is aware of that, hes just made this issue so he can push a PR linked to this which fixes this. Presence intent isn't something thats needed for the core bot to work.

ohhh alright