Skip to content

Commit

Permalink
Merge pull request modmail-dev#3204 from Jerrie-Aries/issue-3203
Browse files Browse the repository at this point in the history
Fix RuntimeError on startup with presence intent disabled.
  • Loading branch information
Taaku18 authored Oct 3, 2022
2 parents b04ac78 + 7960761 commit dc5c940
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ async def runner():
except discord.PrivilegedIntentsRequired:
retry_intents = True
if retry_intents:
await self.http.close()
if self.ws is not None and self.ws.open:
await self.ws.close(code=1000)
self._ready.clear()
Expand All @@ -236,9 +235,9 @@ async def runner():
# Try again with members intent
self._connection._intents = intents
logger.warning(
"Attempting to login with only the server members and message content privileged intent. Some plugins might not work correctly."
"Attempting to reconnect with only the server members and message content privileged intent. Some plugins might not work correctly."
)
await self.start(self.token)
await self.connect(reconnect=True)
except discord.PrivilegedIntentsRequired:
logger.critical(
"Privileged intents are not explicitly granted in the discord developers dashboard."
Expand Down

0 comments on commit dc5c940

Please sign in to comment.