Skip to content

Commit e8be5d1

Browse files
committed
Support only serverv members intent
1 parent 0eab4f3 commit e8be5d1

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ however, insignificant breaking changes do not guarantee a major version bump, s
1414
- `?fareply`, anonymously reply with variables.
1515
- `anonymous_snippets` config variable to toggle if snippets should be anonymous. ([GH #2905](https://github.com/kyb3r/modmail/issues/2905))
1616
- `disable_updates` config variable to control if the update command should be disabled or not.
17+
- Support for only the "Server Members" intent.
1718

1819
### Improved
1920

bot.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,17 @@ def run(self, *args, **kwargs):
192192
except discord.LoginFailure:
193193
logger.critical("Invalid token")
194194
except discord.PrivilegedIntentsRequired:
195-
logger.critical(
196-
"Privileged intents are not explicitly granted in the discord developers dashboard."
197-
)
195+
intents = discord.Intents.default()
196+
intents.members = True
197+
# Try again with members intent
198+
super().__init__(command_prefix=None, intents=intents) # implemented in `get_prefix`
199+
logger.warning("Attempting to login with only the server members privileged intent. Some plugins might not work correctly.")
200+
try:
201+
self.loop.run_until_complete(self.start(self.token))
202+
except discord.PrivilegedIntentsRequired:
203+
logger.critical(
204+
"Privileged intents are not explicitly granted in the discord developers dashboard."
205+
)
198206
except Exception:
199207
logger.critical("Fatal exception", exc_info=True)
200208
finally:

0 commit comments

Comments
 (0)