Skip to content

Commit

Permalink
feat: don't implicitly enable any standard intents
Browse files Browse the repository at this point in the history
Prevents enabling unnecessary intents when updating discord.py
  • Loading branch information
thegamecracks committed Jun 25, 2024
1 parent ba0a754 commit 5beabc5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 1 addition & 5 deletions src/theticketbot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ class SettingsBotInbox(_BaseModel):
class SettingsBotIntents(_BaseModel):
"""The intents used when connecting to the Discord gateway.
Default intents are enabled but can be overridden here.
.. seealso:: https://discordpy.readthedocs.io/en/stable/api.html#intents
"""
Expand All @@ -60,9 +58,7 @@ class SettingsBotIntents(_BaseModel):
def create_intents(self) -> discord.Intents:
import discord

intents = dict(discord.Intents.default())
intents |= self.model_dump()
return discord.Intents(**intents)
return discord.Intents(**self.model_dump())


def check_pragma_statement(s: SecretStr) -> SecretStr:
Expand Down
1 change: 0 additions & 1 deletion src/theticketbot/config_default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ max_attachment_size = 5000000

[bot.intents]
# https://discordpy.readthedocs.io/en/stable/api.html#intents
# All default intents are enabled but can be modified here
guild_messages = true
guilds = true
members = true
Expand Down

0 comments on commit 5beabc5

Please sign in to comment.